/* ==========================================================================
   WorkLink Baao - Authentication
   Login & Registration
   ========================================================================== */

.auth-page {
    min-height: 100vh;
    padding: 2rem 1rem;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top,
            rgba(37, 99, 235, 0.08),
            transparent 34rem),
        var(--wl-bg);
}

.auth-shell {
    width: 100%;
    max-width: 480px;
}

.auth-shell.auth-shell-register {
    max-width: 720px;
}

.auth-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.auth-brand {
    display: inline-flex;
    align-items: center;
    gap: 0.7rem;
    color: var(--wl-text);
    text-decoration: none;
}

.auth-brand:hover {
    color: var(--wl-text);
}

.auth-brand-mark {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 42px;
    overflow: hidden;
    background: #fffdf4;
    border-radius: 11px;
    box-shadow: 0 7px 18px rgba(37, 99, 235, 0.18);
}

.auth-brand-copy {
    line-height: 1.05;
}

.auth-brand-title {
    display: block;
    color: var(--wl-text);
    font-family: var(--wl-font-heading);
    font-size: 1rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.auth-brand-subtitle {
    display: block;
    margin-top: 0.2rem;
    color: var(--wl-primary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-theme-btn {
    width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    display: grid;
    place-items: center;
    background: var(--wl-surface);
    color: var(--wl-muted-text);
    border: 1px solid var(--wl-border);
    border-radius: 50%;
}

.auth-theme-btn:hover {
    color: var(--wl-primary);
    background: var(--wl-surface-soft);
    border-color: var(--wl-primary);
}

.auth-card {
    overflow: hidden;
    background: var(--wl-card-bg);
    border: 1px solid var(--wl-border);
    border-radius: 18px;
    box-shadow: var(--wl-shadow-md);
}

.auth-card-body {
    padding: clamp(1.6rem, 5vw, 2.5rem);
}

.auth-header {
    margin-bottom: 1.8rem;
}

.auth-kicker {
    display: inline-block;
    margin-bottom: 0.5rem;
    color: var(--wl-primary);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.auth-header h1 {
    margin: 0 0 0.55rem;
    color: var(--wl-text);
    font-size: clamp(1.65rem, 4vw, 2rem);
    font-weight: 800;
}

.auth-header p {
    max-width: 560px;
    margin: 0;
    color: var(--wl-muted-text);
    font-size: 0.88rem;
    line-height: 1.65;
}

.auth-alert {
    border-radius: 10px;
    font-size: 0.84rem;
}

.auth-field {
    margin-bottom: 1rem;
}

.auth-field .form-label {
    margin-bottom: 0.42rem;
}

.auth-password-wrap {
    position: relative;
}

.auth-password-wrap .form-control {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    z-index: 5;
    top: 50%;
    right: 0.45rem;
    width: 36px;
    height: 36px;
    min-height: 36px;
    padding: 0;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    background: transparent;
    color: var(--wl-muted-text);
    border: 0;
    border-radius: 8px;
}

.auth-password-toggle:hover {
    background: var(--wl-surface-soft);
    color: var(--wl-primary);
}

.auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 0.25rem 0 1.35rem;
    font-size: 0.82rem;
}

.auth-options .form-check {
    margin: 0;
}

.auth-options a {
    font-weight: 600;
}

.auth-submit {
    width: 100%;
    min-height: 46px;
}

.auth-divider {
    position: relative;
    margin: 1.6rem 0;
    text-align: center;
}

.auth-divider::before {
    content: "";
    position: absolute;
    inset: 50% 0 auto;
    height: 1px;
    background: var(--wl-border);
}

.auth-divider span {
    position: relative;
    padding: 0 0.75rem;
    background: var(--wl-card-bg);
    color: var(--wl-muted-text);
    font-size: 0.72rem;
}

.auth-footer-copy {
    margin: 0;
    color: var(--wl-muted-text);
    text-align: center;
    font-size: 0.82rem;
}

.auth-footer-copy a {
    font-weight: 700;
}

.auth-back {
    margin-top: 1rem;
    text-align: center;
}

.auth-back a {
    color: var(--wl-muted-text);
    font-size: 0.78rem;
    font-weight: 500;
}

.auth-back a:hover {
    color: var(--wl-primary);
}

.auth-role-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.auth-role-option {
    position: relative;
}

.auth-role-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-role-label {
    height: 100%;
    min-height: 92px;
    padding: 0.95rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: var(--wl-surface);
    border: 1px solid var(--wl-border);
    border-radius: 12px;
    cursor: pointer;
    transition:
        border-color 0.16s ease,
        background-color 0.16s ease,
        box-shadow 0.16s ease;
}

.auth-role-label>i {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    background: var(--wl-primary-light);
    color: var(--wl-primary);
    border-radius: 10px;
}

.auth-role-label strong,
.auth-role-label small {
    display: block;
}

.auth-role-label strong {
    margin-bottom: 0.15rem;
    color: var(--wl-text);
    font-size: 0.84rem;
}

.auth-role-label small {
    color: var(--wl-muted-text);
    font-size: 0.72rem;
    line-height: 1.45;
}

.auth-role-option input:checked+.auth-role-label {
    background: var(--wl-primary-light);
    border-color: var(--wl-primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}

.auth-role-option input:focus-visible+.auth-role-label {
    outline: 3px solid rgba(37, 99, 235, 0.18);
    outline-offset: 2px;
}

.auth-password-meter {
    margin-top: 0.55rem;
}

.auth-password-track {
    height: 5px;
    overflow: hidden;
    background: var(--wl-border);
    border-radius: 999px;
}

.auth-password-bar {
    width: 0;
    height: 100%;
    background: var(--wl-border-strong);
    border-radius: inherit;
    transition: width 0.18s ease, background-color 0.18s ease;
}

.auth-password-meta {
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: var(--wl-muted-text);
    font-size: 0.7rem;
}

.auth-policy {
    padding: 0.9rem 1rem;
    background: var(--wl-surface-soft);
    border: 1px solid var(--wl-border);
    border-radius: 10px;
    color: var(--wl-muted-text);
    font-size: 0.76rem;
    line-height: 1.55;
}

.auth-policy i {
    color: var(--wl-primary);
}

.auth-validation {
    min-height: 1.1rem;
    margin-top: 0.35rem;
    font-size: 0.72rem;
}

.auth-validation.is-valid {
    color: var(--wl-success);
}

.auth-validation.is-invalid {
    color: var(--wl-danger);
}

@media (max-width: 575.98px) {
    .auth-page {
        padding: 1.25rem 0.8rem;
        place-items: start center;
    }

    .auth-role-grid {
        grid-template-columns: 1fr;
    }

    .auth-options {
        align-items: flex-start;
        flex-direction: column;
        gap: 0.65rem;
    }
}

/* Final authentication polish shares the WorkLink platform language. */
.auth-page{padding:clamp(1rem,4vw,2rem);background:radial-gradient(circle at top,rgba(16,42,86,.09),transparent 34rem),var(--wl-bg)}
.auth-card{border-radius:16px;box-shadow:0 4px 20px rgba(0,0,0,.06)}
.auth-brand-mark{box-shadow:0 6px 18px rgba(16,42,86,.14)}
.auth-kicker,.auth-brand-subtitle{color:#102a56}
.auth-card .form-control,.auth-card .form-select{min-height:48px}
[data-bs-theme="dark"] .auth-kicker,[data-theme="dark"] .auth-kicker,[data-bs-theme="dark"] .auth-brand-subtitle,[data-theme="dark"] .auth-brand-subtitle{color:#60a5fa}

.auth-brand-mark img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Email OTP authentication ===== */
.auth-security-note {
    display: flex;
    align-items: flex-start;
    gap: .7rem;
    margin: .25rem 0 1rem;
    padding: .85rem 1rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 14px;
    background: var(--bs-tertiary-bg);
    font-size: .86rem;
    line-height: 1.5;
}
.auth-security-note i {
    color: var(--bs-primary);
    margin-top: .1rem;
}
.otp-shield {
    width: 58px;
    height: 58px;
    display: grid;
    place-items: center;
    margin: .35rem auto 1rem;
    border-radius: 18px;
    background: rgba(var(--bs-primary-rgb), .12);
    color: var(--bs-primary);
    font-size: 1.65rem;
}
.otp-email {
    font-weight: 600;
    color: var(--bs-body-color);
}
.otp-input {
    text-align: center;
    font-size: 1.65rem;
    font-weight: 700;
    letter-spacing: .5rem;
    font-variant-numeric: tabular-nums;
}
