/* Auth.css - Authentication page styles */

/* Import design system */
@import url('design-system.css');

/* Use design system variables */
.auth-body {
    font-family: var(--font-family-base);
    background-color: var(--color-gray-50);
    color: var(--color-gray-900);
    display: flex;
    min-height: 100vh;
    margin: 0;
    line-height: var(--leading-normal);
    padding-top: 0 !important;
}

.auth-container {
    display: flex;
    flex-grow: 1;
    width: 100%;
}

.auth-column {
    display: flex;
    flex-direction: column;
    padding: 3rem; /* Base padding, can be overridden */
}

.auth-branding-column {
    flex-basis: 45%;
    background-color: #21237B; /* Original Govin navy */
    color: var(--color-white);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: var(--space-12);
    padding-bottom: 4rem; /* Space for absolute footer */
    position: relative; /* For absolute positioning of footer */
}

.auth-branding-content {
    max-width: 480px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-logo-link-standalone {
    display: block;
    margin-bottom: 1.5rem;
    line-height: 0;
}

.auth-govin-logo-large {
    width: 150px;
    height: 150px;
    fill: var(--color-white);
}

.auth-branding-title {
    font-size: var(--text-2xl);
    font-weight: var(--font-medium);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-8);
    color: var(--color-white);
}

.auth-graphic-placeholder {
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px dashed rgba(255, 255, 255, 0.3);
    border-radius: var(--bs-border-radius-lg);
    padding: 3rem 1.5rem;
    margin-bottom: 2.5rem;
    font-style: italic;
    color: rgba(255, 255, 255, 0.7);
    width: 100%;
}
.auth-graphic-placeholder p {
    margin:0;
}

.auth-compliance-badges-container {
    margin-top: 2rem;
    padding-top: 1.5rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.auth-compliance-badges-container span {
    display: inline-flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--brand-text-on-primary-bg);
    opacity: 0.9;
}
.auth-compliance-badges-container i {
    font-size: 1.4rem;
    margin-right: 0.5rem;
    opacity: 1;
}

.auth-form-column {
    flex-basis: 55%;
    background-color: var(--color-white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    padding: var(--space-12);
}

.auth-form-container {
    width: 100%;
    max-width: 420px;
    /* Removed margin-top to allow vertical centering */
}

.auth-form-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--brand-text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}
.auth-form-subtitle {
    font-size: 0.95rem;
    color: var(--brand-text-secondary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.auth-form-column .form-label {
    font-size: var(--text-sm);
    font-weight: var(--font-medium);
    color: var(--color-gray-700);
    margin-bottom: var(--space-2);
    display: block;
}

.auth-form-column .form-control {
    display: flex;
    width: 100%;
    font-size: var(--text-base);
    padding: var(--space-2) var(--space-4);
    border: 1px solid var(--color-gray-300);
    border-radius: var(--radius-md);
    background-color: var(--color-white);
    color: var(--color-gray-900);
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-base);
}

.auth-form-column .form-control:hover:not(:disabled) {
    border-color: var(--color-gray-400);
}

.auth-form-column .form-control:focus {
    outline: 2px solid var(--color-violet-400);
    outline-offset: 2px;
    border-color: var(--color-violet-400);
}

.auth-form-column .form-control::placeholder {
    color: var(--color-gray-400);
}

/* Input groups removed - using clean inputs like React components */

.auth-form-column .btn.auth-btn {
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-weight: var(--font-medium);
    border-radius: var(--radius-full);
    width: 100%;
}

/* Primary button override for auth page */
.auth-form-column .btn-primary {
    background-color: var(--color-primary); /* #21237B */
    border-color: var(--color-primary);
    color: var(--color-white);
}

.auth-form-column .btn-primary:hover, 
.auth-form-column .btn-primary:focus, 
.auth-form-column .btn-primary:active {
    background-color: var(--color-primary-dark); /* #181A5D */
    border-color: var(--color-primary-dark);
    color: var(--color-white);
}

.auth-form-column .btn-primary:disabled {
    background-color: var(--color-gray-200);
    border-color: var(--color-gray-400);
    color: var(--color-gray-400);
}


/* Microsoft SSO Button - Following Microsoft branding guidelines */
.btn-microsoft {
    background-color: #FFFFFF;
    border: 1px solid #8C8C8C;
    color: #5E5E5E;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-full); /* Match primary button radius */
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 15px;
    font-weight: 600;
    line-height: 20px;
    transition: all var(--transition-base);
    width: 100%; /* Full width like primary button */
    height: auto;
    text-decoration: none;
}

.btn-microsoft:hover {
    background-color: #F3F2F1;
    border-color: #8C8C8C;
    color: #5E5E5E;
    box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}

.btn-microsoft:active {
    background-color: #EDEBE9;
    border-color: #8C8C8C;
    transform: scale(0.98);
}

.btn-microsoft:focus {
    outline: 2px solid #000;
    outline-offset: -2px;
}

.btn-microsoft svg {
    width: 21px;
    height: 21px;
    flex-shrink: 0;
}

/* Dark theme variant */
.btn-microsoft.dark {
    background-color: #2F2F2F;
    border-color: #2F2F2F;
    color: var(--color-white);
}

.btn-microsoft.dark:hover {
    background-color: #3B3B3B;
    border-color: #3B3B3B;
    color: var(--color-white);
}

.btn-microsoft.dark:active {
    background-color: #292929;
    border-color: #292929;
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--brand-text-secondary);
    font-size: 0.8rem;
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--brand-border-color);
}
.auth-divider:not(:empty)::before {
    margin-right: .5em;
}
.auth-divider:not(:empty)::after {
    margin-left: .5em;
}

.auth-link {
    font-size: 0.875rem;
    color: var(--brand-text-link);
    text-decoration: none;
}
.auth-link:hover {
    color: var(--brand-text-link-hover);
    text-decoration: underline;
}

.auth-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 3rem; /* Consistent padding with the column */
    text-align: center;
    font-size: var(--text-xs);
    color: var(--color-gray-500);
}

/* Footer in branding column (navy background) */
.auth-footer-branding {
    color: rgba(255, 255, 255, 0.7);
}
.auth-footer-branding p {
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.7);
}
.auth-footer-branding a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color var(--transition-base);
}
.auth-footer-branding a:hover {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: underline;
}

/* Footer in form column (white background) - kept for backwards compatibility */
.auth-form-column .auth-footer p {
    margin-bottom: 0;
    color: var(--color-gray-500);
}
.auth-form-column .auth-footer a {
    color: var(--color-gray-500);
    text-decoration: none;
    transition: color var(--transition-base);
}
.auth-form-column .auth-footer a:hover {
    color: var(--color-gray-600);
    text-decoration: underline;
}

/* 2FA Specifics - OTP Styles */
.otp-input {
    width: 48px;
    height: 58px;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    padding: 0.5rem 0.25rem;
    border: 1px solid var(--brand-input-border);
    border-radius: var(--bs-border-radius-sm);
    caret-color: var(--brand-primary);
}
.otp-input:focus {
    border-color: var(--brand-input-focus-border);
    box-shadow: 0 0 0 0.2rem var(--brand-input-focus-shadow);
    outline: none;
}

.invalid-feedback {
    font-size: 0.8rem;
}

.auth-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 1); /* Full opacity */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
}
.auth-loading-overlay .spinner-border {
    width: 3rem;
    height: 3rem;
}
.auth-loading-overlay p {
    color: var(--brand-text-primary);
    font-weight: 500;
}

/* Responsive - Tablet and Mobile */
@media (max-width: 991.98px) {
    .auth-container {
        flex-direction: column-reverse; /* Branding at bottom */
    }
    .auth-column {
        padding: 2rem 1.5rem; /* General padding adjustment */
    }
    .auth-branding-column {
        flex-basis: auto;
        min-height: 300px; /* Give branding section some minimum height */
        padding: 2rem 1.5rem;
        padding-bottom: 5rem; /* Extra space for footer on mobile */
    }
    .auth-govin-logo-large { width: 120px; height: 120px; }
    .auth-branding-title { font-size: 1.25rem; margin-bottom: 1.5rem; }
    .auth-graphic-placeholder { padding: 2rem 1rem; margin-bottom: 1.5rem; }
    .auth-compliance-badges-container {
        font-size: 0.8rem;
        margin-top: 1.5rem;
        margin-bottom: 2rem; /* Add bottom margin to create space from footer */
        padding-top: 1.5rem;
        gap: 1rem;
    }
    .auth-compliance-badges-container i { font-size: 1.2rem; }

    .auth-form-column {
        flex-basis: auto;
        min-height: calc(100vh - 300px); /* Take remaining space */
        padding: 2rem 1.5rem;
        position: static; /* Remove relative positioning on mobile */
    }
    .auth-form-container {
        margin-top: 2rem;
        margin-bottom: 2rem;
    }
    /* Footer stays with branding column */
    .auth-footer {
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        padding: 1rem 1.5rem;
        font-size: 0.75rem; /* Smaller on mobile */
    }

    #otpInputs {
        gap: 0.5rem;
    }
    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* Mobile specific styles */
@media (max-width: 767.98px) {
    .auth-branding-column {
        min-height: 280px; /* Slightly more height to accommodate footer spacing */
        padding-bottom: 4.5rem; /* Ensure footer has space */
    }
    .auth-form-column {
        min-height: calc(100vh - 280px);
    }
    .auth-branding-title {
        font-size: 1.1rem;
    }
    .auth-govin-logo-large { width: 100px; height: 100px; }
    .auth-compliance-badges-container { 
        margin-bottom: 1.5rem; /* Space between badges and footer */
    }
    .auth-compliance-badges-container span { font-size: 0.75rem; }
    .auth-compliance-badges-container i { font-size: 1.1rem; }
    .otp-input {
        width: 36px;
        height: 46px;
        font-size: 1.3rem;
    }
    .btn-microsoft, .btn-google {
        font-size: 14px;
        padding: var(--space-2) var(--space-3);
        height: auto;
    }
    .btn-microsoft svg, .btn-google svg {
        width: 18px;
        height: 18px;
    }
}