/* ============================================
   Africorp Financial Services Portal - Login Page
   ============================================  */

/* --- Page & Background ---  */
.login-page {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #fff;
}

.login-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    height: 100%;
    width: 100%;
}

.login-bg-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.60);
    z-index: 1;
}

.login-bg-image {
    height: 100%;
    width: 100%;
    background-size: cover;
    background-position: center;
    background-image: url('/Images/africorpBackground.png');
}

/* --- Header ---  */
.login-header {
    position: relative;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 4rem;
    border-bottom: var(--glass-border-sidebar);
    backdrop-filter: var(--glass-blur-light);
    -webkit-backdrop-filter: var(--glass-blur-light);
    background: var(--glass-bg-heavy);
}

.login-logo {
    height: 3rem;
    width: auto;
}

.btn-return-website {
    background: rgba(35, 34, 31, 0.4);
    color: #fff;
    padding: 0.375rem 0.875rem;
    border-radius: 0.5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(12px);
    box-shadow: var(--glass-shadow-sm);
}

.btn-return-website:hover {
    background: rgba(35, 34, 31, 0.6);
    border-color: rgba(255, 255, 255, 0.12);
    color: #fff;
    text-decoration: none;
}

/* --- Main Content ---  */
.login-main {
    position: relative;
    z-index: 20;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
}

.login-title-section {
    text-align: center;
    margin-bottom: 2.5rem;
    max-width: 42rem;
}

.login-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -0.025em;
    text-transform: uppercase;
    color: #fff;
}

.login-subtitle {
    color: #b0b0b0;
    font-size: 1.125rem;
}

/* --- Cards Grid ---  */
.login-cards-grid {
    width: 100%;
    max-width: 72rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: stretch;
}

@media (max-width: 768px) {
    .login-header {
        padding: 1rem 1.5rem;
    }

    .login-cards-grid {
        grid-template-columns: 1fr;
        max-width: 28rem;
        margin: 0 auto;
    }

    .login-title {
        font-size: 1.75rem;
    }

    .login-subtitle {
        font-size: 0.9375rem;
    }

    .login-main {
        padding: 2rem 1rem;
    }

    .login-title-section {
        margin-bottom: 1.5rem;
    }

    .login-card {
        padding: 1.5rem;
        border-radius: 1.25rem;
    }

    .login-card-footer {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}

@media (max-width: 480px) {
    /* Small phone (≤480px)  */
    .login-header {
        padding: 0.75rem 1rem;
    }

    .login-logo {
        height: 2rem;
    }

    .btn-return-website {
        font-size: 0.75rem;
        padding: 0.375rem 0.875rem;
        background-color: var(--gold);
    }

    .login-title {
        font-size: 1.375rem;
    }

    .login-main {
        padding: 1.5rem 0.75rem;
    }

    .login-card {
        padding: 1.25rem;
    }

    .login-chooser-card {
        padding: 1.75rem 1.25rem;
    }

    .login-chooser-icon-wrapper {
        width: 3.5rem;
        height: 3.5rem;
    }
}

/* --- Card Base ---  */
.login-card {
    padding: 2rem;
    border-radius: 2rem;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.login-card-client {
    background: rgba(35, 34, 31, 0.9);
    border: rgba(177, 141, 89, 0.2);
}

.login-card-employee {
    background: rgba(35, 34, 31, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.login-card-accent {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: #b18d59;
}

/* --- Card Header ---  */
.login-card-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.login-card-icon {
    padding: 0.75rem;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-card-icon-primary {
    background: rgba(177, 141, 89, 0.1);
}

    .login-card-icon-primary .material-symbols-outlined {
        color: #b18d59;
        font-size: 1.75rem;
    }

.login-card-icon-muted {
    background: rgba(255, 255, 255, 0.05);
}

    .login-card-icon-muted .material-symbols-outlined {
        color: #9ca3af;
    }

.login-card-title {
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: -0.025em;
    margin: 0;
}

.login-card-label {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 900;
    margin: 0;
}

.login-card-label-primary {
    color: #b18d59;
}

.login-card-label-muted {
    color: #6b7280;
}

/* --- Form ---  */
.login-card-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.login-card-form-content {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.login-card-description {
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.6;
    margin: 0;
}

.text-white {
    color: #fff;
}

.text-bold {
    font-weight: 700;
}

/* --- Field ---  */
.login-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.login-field-label {
    display: block;
    font-size: 0.625rem;
    font-weight: 900;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.login-input-wrapper {
    position: relative;
}

.login-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #4b5563;
    font-size: 1.25rem;
    pointer-events: none;
    transition: color 0.2s;
}

.login-input {
    width: 100%;
    border-radius: 0.75rem;
    padding: 1.125rem 1rem 1.125rem 3rem;
    outline: none;
    transition: all 0.2s;
    font-size: 0.875rem;
    box-sizing: border-box;
}

.login-input-primary {
    background: rgba(10, 9, 8, 0.70);
    border: 1px solid rgba(177, 141, 89, 0.15);
    color: #b18d59;
    font-family: 'Consolas', 'Courier New', monospace;
}

    .login-input-primary::placeholder {
        color: #374151;
    }

    .login-input-primary:focus {
        border-color: #b18d59;
        box-shadow: 0 0 0 1px #b18d59;
    }

        .login-input-primary:focus ~ .login-input-icon,
        .login-input-primary:focus + .login-input-icon {
            color: #b18d59;
        }

.login-input-muted {
    background: rgba(10, 9, 8, 0.60);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 500;
}

    .login-input-muted::placeholder {
        color: #374151;
    }

    .login-input-muted:focus {
        border-color: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2);
    }

/* --- Error ---  */
.login-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #f87171;
    font-size: 0.75rem;
    font-weight: 700;
    animation: pulse 2s infinite;
}

    .login-error .material-symbols-outlined {
        font-size: 0.875rem;
    }

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* --- Buttons ---  */
.login-card-actions {
    padding-top: 1rem;
}

.btn-client-login {
    width: 100%;
    background-color: #b18d59;
    color: #1a1a17;
    font-weight: 900;
    padding: 1.125rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
    box-shadow: 0 10px 25px rgba(177, 141, 89, 0.1);
}

    .btn-client-login:hover {
        background-color: #c9a76c;
    }

    .btn-client-login:hover .btn-icon-right {
        transform: translateX(4px);
    }

.btn-employee-login {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    color: #fff;
    font-weight: 900;
    padding: 1rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.75rem;
}

    .btn-employee-login:hover {
        background: rgba(255, 255, 255, 0.14);
        border-color: rgba(255, 255, 255, 0.20);
        color: #fff;
    }

    .btn-employee-login:hover .btn-icon-right {
        transform: translateX(4px);
    }

.btn-icon-right {
    transition: transform 0.2s;
}

/* --- Field Support ---  */
.login-field-support {
    display: flex;
    justify-content: flex-end;
}

.login-support-link {
    font-size: 0.625rem;
    color: #6b7280;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    transition: color 0.2s;
}

    .login-support-link:hover {
        color: #fff;
    }

/* --- Card Footer ---  */
.login-card-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(177, 141, 89, 0.10);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.login-card-footer-center {
    justify-content: center;
    text-align: center;
}

.login-card-footer-text {
    font-size: 0.5625rem;
    color: #6b7280;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.login-card-footer-link {
    font-size: 0.5625rem;
    color: #b18d59;
    text-decoration: none;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

    .login-card-footer-link:hover {
        text-decoration: underline;
    }

.login-card-footer-badge {
    font-size: 0.5625rem;
    color: #4b5563;
    text-transform: uppercase;
    line-height: 1.6;
    font-weight: 700;
    letter-spacing: 0.2em;
    margin: 0;
}

/* --- Microsoft Sign-In Button ---  */
.login-microsoft-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    padding: 1rem 0;
}

.btn-microsoft-login {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    max-width: 20rem;
    background-color: #fff;
    color: #3c4043;
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    padding: 0.875rem 1.5rem;
    border: 1px solid #dadce0;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

    .btn-microsoft-login:hover {
        background-color: #f8f9fa;
        border-color: #b0b0b0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }

    .btn-microsoft-login:active {
        background-color: #e8eaed;
    }

.microsoft-logo {
    flex-shrink: 0;
}

/* --- Chooser Cards (Landing Page) ---  */
.login-chooser-card {
    padding: 2.5rem 2rem;
    border-radius: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

    .login-chooser-card.login-card-client {
        background: rgba(35, 34, 31, 0.9);
        border: 1px solid rgba(177, 141, 89, 0.2);
    }

    .login-chooser-card.login-card-employee {
        background: rgba(35, 34, 31, 0.4);
        border: 1px solid rgba(255, 255, 255, 0.05);
    }

.login-chooser-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--glass-shadow-xl);
    border-color: rgba(177, 141, 89, 0.40);
}

.login-chooser-card:hover .login-chooser-action {
    color: var(--gold);
}

.login-chooser-card:hover .btn-icon-right {
    transform: translateX(4px);
}

.login-chooser-card:active {
    transform: translateY(-1px);
}

.login-chooser-icon-wrapper {
    width: 4.5rem;
    height: 4.5rem;
    border-radius: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.login-chooser-icon {
    font-size: 2.25rem;
}

.login-chooser-description {
    font-size: 0.875rem;
    color: #9ca3af;
    line-height: 1.6;
    margin: 1rem 0 1.5rem;
    max-width: 22rem;
}

.login-chooser-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: #b18d59;
    transition: gap 0.2s;
}

.login-chooser-card:hover .login-chooser-action {
    gap: 0.75rem;
}

.login-chooser-card.login-card-employee .login-chooser-action {
    color: #9ca3af;
}

.login-chooser-card.login-card-employee:hover .login-chooser-action {
    color: #fff;
}

/* --- Single Card Layout (Dedicated Login Pages) ---  */
.login-single-card-wrapper {
    width: 100%;
    max-width: 36rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.login-card-wide {
    width: 100%;
}

/* --- Switch Prompt (Cross-link between login types) ---  */
.login-switch-prompt {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    color: #9ca3af;
    flex-wrap: wrap;
    justify-content: center;
}

.login-switch-icon {
    font-size: 1.125rem;
    color: #6b7280;
}

.login-switch-link {
    color: #b18d59;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s;
}

    .login-switch-link:hover {
        color: #c9a76c;
        text-decoration: underline;
    }

/* ============================================
   Authentication / Loading Screen
   ============================================  */

.auth-status-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 100%;
    max-width: 28rem;
}

.auth-status-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 2rem;
    background: rgba(35, 34, 31, 0.9);
    border: 1px solid rgba(177, 141, 89, 0.18);
    backdrop-filter: blur(6px);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
}

.auth-status-title {
    font-size: 1.5rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #fff;
    margin: 1.5rem 0 0.5rem;
}

.auth-status-message {
    font-size: 0.875rem;
    color: #9ca3af;
    margin: 0;
    line-height: 1.6;
}

    .auth-status-message a {
        color: #b18d59;
        text-decoration: none;
        font-weight: 700;
    }

        .auth-status-message a:hover {
            text-decoration: underline;
            color: #c9a76c;
        }

.auth-status-inline {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 0;
    text-align: center;
}

/* --- Spinner ---  */
.auth-spinner {
    width: 3rem;
    height: 3rem;
    border: 3px solid rgba(177, 141, 89, 0.15);
    border-top-color: #b18d59;
    border-radius: 50%;
    animation: auth-spin 0.8s linear infinite;
}

@keyframes auth-spin {
    to {
        transform: rotate(360deg);
    }
}

/* --- Status Icons ---  */
.auth-error-icon {
    font-size: 2.5rem;
    color: #f87171;
}

.auth-success-icon {
    font-size: 2.5rem;
    color: #4ade80;
}

.auth-status-error .auth-status-message {
    color: #f87171;
}

/* ============================================
   OTP Verification Step
   ============================================  */

/* --- Single OTP Input Group ---  */
.otp-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
}

.otp-single {
    width: 100%;
    max-width: 16rem;
}

.otp-input {
    text-align: center;
    font-size: 1.75rem;
    font-weight: 900;
    letter-spacing: 0.5em;
    padding: 1rem 0.5rem !important;
    font-family: 'Courier New', monospace;
}

/* --- Timer Section ---  */
.otp-timer-section {
    display: flex;
    justify-content: center;
    margin-top: 0.25rem;
}

.otp-timer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    background: rgba(177, 141, 89, 0.08);
    border: 1px solid rgba(177, 141, 89, 0.15);
}

.otp-timer-icon {
    font-size: 1.125rem;
    color: #b18d59;
}

.otp-timer-text {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 700;
    letter-spacing: 0.05em;
}

    .otp-timer-text strong {
        color: #b18d59;
        font-family: 'Courier New', monospace;
        font-size: 0.875rem;
    }

.otp-timer-expired {
    background: rgba(248, 113, 113, 0.08);
    border-color: rgba(248, 113, 113, 0.15);
}

    .otp-timer-expired .otp-timer-icon {
        color: #f87171;
    }

    .otp-timer-expired .otp-timer-text {
        color: #f87171;
    }

/* --- OTP Actions (Verify + Resend) ---  */
.otp-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.btn-otp-resend {
    width: 100%;
    background: rgba(255, 255, 255, 0.07);
    color: #9ca3af;
    font-weight: 900;
    padding: 0.875rem;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.10);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-size: 0.6875rem;
}

    .btn-otp-resend:hover:not(:disabled) {
        background: rgba(177, 141, 89, 0.10);
        border-color: rgba(177, 141, 89, 0.25);
        color: #b18d59;
    }

    .btn-otp-resend:disabled {
        opacity: 0.35;
        cursor: not-allowed;
    }

    .btn-otp-resend .material-symbols-outlined {
        font-size: 1.125rem;
    }

.btn-client-login:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

    .btn-client-login:disabled:hover {
        background-color: #b18d59;
    }

.auth-spinner-small {
    width: 1rem;
    height: 1rem;
    border-width: 2px;
}
