/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

.form-container {
    background: white;
    max-width: 400px;
    width: 100%;
    padding: 32px;
    border-radius: 2px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

/* Footer */
.footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: center;
    padding: 32px 16px;
}

.footer-content {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.footer-content a {
    color: #666;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    height: 8rem;
    max-width: 100%;
}

.logo-fallback {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: bold;
    color: #1f2937;
}

.logo-dot {
    width: 0.5rem;
    height: 0.5rem;
    background-color: #10b981;
    border-radius: 50%;
}

/* Header section */
.header-section {
    text-align: center;
    margin-bottom: 24px;
}

.header-section h1 {
    font-size: 32px;
    font-weight: 600;
    margin-bottom: 16px;
    color: #1a1a1a;
}

.error-subtitle {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #dc2626;
    padding: 12px;
    border-radius: 4px;
    font-size: 14px;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.learn-more-link {
    color: #2563eb;
    text-decoration: underline;
    font-size: 14px;
}

.learn-more-link:hover {
    color: #1d4ed8;
}

.signup-link {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.signup-link a {
    color: #2563eb;
    text-decoration: underline;
}

.signup-link a:hover {
    color: #1d4ed8;
}

.required-note {
    font-size: 12px;
    color: #666;
    margin-bottom: 16px;
}

/* Form Styles */
.login-form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-group input {
    width: 100%;
    height: 3rem;
    padding: 0 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-group input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.password-container {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: #6b7280;
}

.eye-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 1rem 0;
}

.checkbox-group input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: #3b82f6;
}

.checkbox-group label {
    font-size: 0.875rem;
    color: #374151;
    margin: 0;
}

/* Button Styles */
.submit-btn {
    width: 100%;
    height: 3rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
    margin-top: 1.5rem;
    position: relative;
    overflow: hidden;
}

.submit-btn:hover {
    background-color: #2563eb;
}

.submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
}

.btn-text,
.btn-loading {
    transition: opacity 0.15s ease-in-out;
}

.submit-btn.loading .btn-text {
    opacity: 0;
}

.submit-btn.loading .btn-loading {
    opacity: 1;
}

.submit-btn:not(.loading) .btn-loading {
    opacity: 0;
}

.forgot-password {
    text-align: center;
    margin-top: 1rem;
}

.forgot-password a {
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: underline;
}

.forgot-password a:hover {
    color: #1d4ed8;
}

/* Social Login Section */
.social-section {
    border-top: 1px solid #e5e7eb;
    padding-top: 1.5rem;
}

.divider {
    text-align: center;
    color: #9ca3af;
    font-size: 0.875rem;
    margin-bottom: 1.5rem;
    position: relative;
}

.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 45%;
    height: 1px;
    background-color: #e5e7eb;
}

.divider::before {
    left: 0;
}

.divider::after {
    right: 0;
}

.social-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.social-btn {
    height: 3rem;
    border: 1px solid #d1d5db;
    background: white;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.social-btn:hover {
    background-color: #f9fafb;
}

.social-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.more-options-btn {
    width: 100%;
    height: 3rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.more-options-btn:hover {
    background-color: #f9fafb;
}

/* Code Verification Styles */
.verification-form {
    text-align: center;
}

.code-input-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem;
}

.code-input {
    width: 3rem !important;
    height: 3rem !important;
    text-align: center;
    font-size: 1.5rem;
    font-weight: bold;
    border: 2px solid #d1d5db !important;
    border-radius: 0.375rem;
}

.code-input:focus {
    border-color: #3b82f6 !important;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1) !important;
}

.resend-section {
    margin-top: 1.5rem;
    text-align: center;
}

.resend-section p {
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
}

.resend-btn {
    background: none;
    border: none;
    color: #2563eb;
    text-decoration: underline;
    cursor: pointer;
    font-size: 0.875rem;
}

.resend-btn:hover {
    color: #1d4ed8;
}

/* Success Page Styles */
.success-container {
    text-align: center;
}

.success-icon {
    width: 4rem;
    height: 4rem;
    background-color: #10b981;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
}

.success-icon svg {
    width: 2rem;
    height: 2rem;
}

.success-container h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 1rem;
}

.success-message {
    color: #6b7280;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.success-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.primary-btn {
    width: 100%;
    height: 3rem;
    background-color: #3b82f6;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.primary-btn:hover {
    background-color: #2563eb;
}

.secondary-btn {
    width: 100%;
    height: 3rem;
    background: white;
    color: #374151;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.15s ease-in-out;
}

.secondary-btn:hover {
    background-color: #f9fafb;
}

/* Toast Styles */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.toast {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    padding: 1rem;
    margin-bottom: 0.5rem;
    min-width: 300px;
    max-width: 400px;
    opacity: 0;
    transform: translateX(100%);
    transition: all 0.3s ease-in-out;
}

.toast.show {
    opacity: 1;
    transform: translateX(0);
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast-header {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.toast-description {
    font-size: 0.875rem;
    color: #6b7280;
}

/* Responsive Design */
@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    .form-container {
        padding: 1.5rem;
    }
    
    .logo {
        height: 6rem;
    }
    
    .social-buttons {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .code-input-container {
        gap: 0.25rem;
    }
    
    .code-input {
        width: 2.5rem !important;
        height: 2.5rem !important;
        font-size: 1.25rem;
    }
    
    .success-actions {
        gap: 0.5rem;
    }
}

/* Loading States */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

/* Animation for form transitions */
.form-container {
    animation: fadeInUp 0.5s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus states for accessibility */
button:focus,
input:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Disabled state styling */
.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.submit-btn:disabled:hover {
    background-color: #9ca3af;
}

/* Third Attempt Page Layout */
.idme-background {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.page-container {
    width: 100%;
    max-width: 28rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.idme-card {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-radius: 2px;
    max-width: 24rem;
    width: 100%;
    padding: 2rem;
}

.form-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Large logo for third attempt */
.logo-large {
    height: 8rem;
    margin-bottom: 1.5rem;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.step {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    font-size: 0.875rem;
    font-weight: 600;
    color: white;
}

.step.completed {
    background-color: #9ca3af;
}

.step.active {
    background-color: #2563eb;
}

.step.inactive {
    background-color: #9ca3af;
}

.step-line {
    width: 2rem;
    height: 0.125rem;
    background-color: #9ca3af;
}

/* Header Section for Third Attempt */
.header-section h1 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 1rem;
    text-align: center;
}

.header-section .subtitle {
    font-size: 0.875rem;
    color: #4b5563;
    margin-bottom: 0.5rem;
    text-align: center;
}

.header-section .learn-more-link {
    font-size: 0.875rem;
    color: #2563eb;
    text-decoration: underline;
    display: block;
    text-align: center;
}

.header-section .learn-more-link:hover {
    color: #1d4ed8;
}

/* MFA Options */
.mfa-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mfa-card {
    cursor: pointer;
    border: 2px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 1rem;
    transition: all 0.2s ease-in-out;
    background: white;
}

.mfa-card:hover {
    border-color: #d1d5db;
}

.mfa-card.selected {
    border-color: #3b82f6;
    background-color: #eff6ff;
}

.mfa-content {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mfa-icon-container {
    flex-shrink: 0;
    width: 2.5rem;
    height: 2.5rem;
    background-color: #dbeafe;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mfa-icon {
    width: 1.5rem;
    height: 1.5rem;
    color: #2563eb;
}

.mfa-details {
    flex: 1;
}

.mfa-details h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #111827;
    margin-bottom: 0.25rem;
}

.security-level {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.security-bars {
    display: flex;
    gap: 0.25rem;
}

.bar {
    width: 1rem;
    height: 0.25rem;
    border-radius: 0.125rem;
}

.bar.filled.orange {
    background-color: #fb923c;
}

.bar.filled.green {
    background-color: #34d399;
}

.bar.empty {
    background-color: #e5e7eb;
}

.security-text {
    font-size: 0.75rem;
    color: #4b5563;
}

/* MFA Recovery */
.mfa-recovery {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #4b5563;
}

.mfa-recovery p {
    margin-bottom: 0.25rem;
}

.mfa-recovery a {
    color: #2563eb;
    text-decoration: underline;
}

.mfa-recovery a:hover {
    color: #1d4ed8;
}

/* Footer for page layout */
.footer {
    text-align: center;
    font-size: 0.75rem;
    color: #4b5563;
    margin-top: 2rem;
    padding: 0 1rem;
}

.footer-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.footer-content a {
    color: #4b5563;
    text-decoration: none;
}

.footer-content a:hover {
    text-decoration: underline;
}