

:root {
    --primary: #FF6B35;
    --primary-light: #FF8A65;
    --primary-dark: #E55A2B;
    --primary-darker: #CC4A1F;
    --secondary: #10B981;
    --secondary-light: #34D399;
    --accent: #F59E0B;
    --accent-light: #FBBF24;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --text-dark: #1F2937;
    --text-light: #6B7280;
    --text-lighter: #9CA3AF;
    --bg-color: #F9FAFB;
    --bg-secondary: #FFFFFF;
    --bg-tertiary: #F3F4F6;
    --border-color: #E5E7EB;
    --border-light: #F3F4F6;
    --box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --box-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --box-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --box-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --border-radius-xl: 16px;
    --gradient-primary: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
    --gradient-accent: linear-gradient(135deg, var(--accent) 0%, var(--accent-light) 100%);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body { 
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-color);
    color: var(--text-dark);
    min-height: 100vh;
    line-height: 1.6;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.form-box { 
    display: flex;
    width: 100%;
    max-width: 480px;
    align-items: center;
    justify-content: center;
}

.form-container { 
    width: 100%;
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    padding: 2.5rem;
    box-shadow: var(--box-shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.form-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.form-container h2 {
    font-family: 'Inter', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

input, button, select { 
    width: 100%;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    border: 1px solid var(--border-color);
    margin: 0.5rem 0;
    background: var(--bg-secondary);
    color: var(--text-dark);
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.15);
}

input::placeholder {
    color: var(--text-lighter);
}

button { 
    background: var(--gradient-primary);
    border: none;
    font-weight: 600;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

button:active {
    transform: translateY(0);
}

#msSsoBtn {
    background: var(--gradient-primary);
    margin: 1rem 0;
    font-size: 1.1rem;
    padding: 1rem 1.5rem;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--box-shadow-md);
}

#msSsoBtn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--box-shadow-lg);
}

.sso-info {
    font-size: 0.875rem;
    color: var(--text-light);
    margin-top: 1rem;
    text-align: center;
    line-height: 1.4;
    padding: 0.75rem;
    background: rgba(255, 107, 53, 0.1);
    border-radius: var(--border-radius);
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.sso-info strong {
    color: var(--text-dark);
}

.logout-message {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.tip {
    font-size: 0.875rem;
    color: var(--text-light);
    text-align: center;
    margin-top: 1rem;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border-radius: var(--border-radius);
    border-left: 3px solid var(--primary);
}

/* SSO Email styling */
input[readonly] {
    background: var(--bg-tertiary);
    color: var(--text-light);
    border-color: var(--primary);
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }
    
    .form-container {
        padding: 2rem 1.5rem;
        margin: 1rem;
    }
    
    .form-container h2 {
        font-size: 1.5rem;
        margin-bottom: 1.25rem;
    }
    
    input, button, select {
        padding: 0.75rem 0.875rem;
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .form-container {
        padding: 1.5rem 1rem;
        margin: 0.5rem;
    }
    
    .form-container h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    input, button, select {
        padding: 0.75rem;
        font-size: 0.9rem;
        margin: 0.375rem 0;
    }
    
    .sso-info {
        font-size: 0.8rem;
    }
    
    .tip {
        font-size: 0.8rem;
        padding: 0.625rem;
    }
}

@media (max-width: 360px) {
    .form-container {
        padding: 1.25rem 0.875rem;
    }
    
    .form-container h2 {
        font-size: 1.125rem;
    }
    
    input, button, select {
        padding: 0.625rem;
        font-size: 0.875rem;
    }
}

/* Animation for form appearance */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-container {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading state for buttons */
button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Focus styles for accessibility */
button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.4);
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .form-container {
        border: 2px solid var(--text-dark);
    }
    
    input, button, select {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Popup Styles */
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.popup-content {
    background: var(--bg-secondary);
    border-radius: var(--border-radius-xl);
    padding: 2rem;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--box-shadow-xl);
    border: 1px solid var(--border-color);
    position: relative;
    animation: popupSlideIn 0.3s ease-out;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.popup-header h3 {
    margin: 0;
    color: var(--text-dark);
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: var(--bg-tertiary);
    color: var(--text-dark);
}

.popup-content h4 {
    color: var(--text-dark);
    margin-bottom: 1rem;
    font-size: 1.25rem;
    font-weight: 600;
}

.popup-content p {
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Message animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

@keyframes popupSlideIn {
    from {
        transform: scale(0.9) translateY(-20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Form improvements */
#loginForm {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

#loginForm input {
    margin: 0;
}

#loginForm button {
    margin: 0;
    margin-top: 0.5rem;
}

/* Registration button styling */
#registerBtn {
    background: var(--gradient-secondary);
    border: none;
    font-weight: 600;
    cursor: pointer;
    color: white;
    font-size: 1rem;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
    padding: 0.875rem 1.5rem;
    border-radius: var(--border-radius);
}

#registerBtn:hover {
    transform: translateY(-1px);
    box-shadow: var(--box-shadow-md);
}

/* Divider styling */
hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 1.5rem 0;
}

/* Responsive popup */
@media (max-width: 768px) {
    .popup-content {
        padding: 1.5rem;
        margin: 1rem;
        width: calc(100% - 2rem);
    }
    
    .popup-header h3 {
        font-size: 1.25rem;
    }
}

@media (max-width: 480px) {
    .popup-content {
        padding: 1.25rem;
        margin: 0.5rem;
        width: calc(100% - 1rem);
    }
    
    .popup-header h3 {
        font-size: 1.125rem;
    }
}