/* assets/css/auth.css
   Styling for the Login Module screens (login, forgot password).
   Loaded after Bootstrap 5 — only overrides/extends what Bootstrap needs.
*/

:root {
    --kvc-green-dark: #1f4d2c;
    --kvc-green: #2e7d42;
    --kvc-green-light: #eaf3e5;
    --kvc-amber: #d98c1f;
    --kvc-text-muted: #6b7280;
}

html, body {
    height: 100%;
}

body.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, var(--kvc-green-dark) 0%, var(--kvc-green) 55%, #3f9153 100%);
    padding: 24px;
}

.auth-shell {
    width: 100%;
    max-width: 940px;
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
    display: flex;
    min-height: 560px;
}

.auth-side {
    flex: 0 0 42%;
    background: var(--kvc-green-dark);
    color: #ffffff;
    padding: 48px 40px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.auth-side .brand-badge {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 24px;
}

.auth-side h1 {
    font-size: 1.5rem;
    font-weight: 600;
    line-height: 1.35;
    margin-bottom: 12px;
}

.auth-side p.lead-copy {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
}

.auth-side .branch-tags {
    display: flex;
    gap: 8px;
    margin-top: 24px;
}

.auth-side .branch-tags span {
    font-size: 0.75rem;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.auth-side .side-footer {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.55);
}

.auth-main {
    flex: 1 1 auto;
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-main h2 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 4px;
}

.auth-main .auth-subtitle {
    color: var(--kvc-text-muted);
    font-size: 0.9rem;
    margin-bottom: 28px;
}

/* Portal chooser (auth/login.php) */
.portal-choice-grid {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.portal-choice-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color .15s ease, background-color .15s ease, transform .15s ease;
}
.portal-choice-card:hover {
    border-color: var(--kvc-green, #1e6b2c);
    background-color: #f5f9f5;
    transform: translateY(-1px);
}
.portal-choice-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: #eef6ee;
    color: var(--kvc-green, #1e6b2c);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}
.portal-choice-title {
    display: block;
    font-weight: 600;
    color: #1f2937;
    font-size: 0.98rem;
}
.portal-choice-desc {
    display: block;
    color: var(--kvc-text-muted, #6b7280);
    font-size: 0.82rem;
    margin-top: 2px;
}

/* Portal-specific badge shown on the 3 dedicated login pages
   (admin/login.php, aurora/login.php, ramon/login.php) */
.portal-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 999px;
    background: #eef6ee;
    color: var(--kvc-green, #1e6b2c);
    font-size: 0.78rem;
    font-weight: 600;
    margin-bottom: 14px;
}
.back-to-portals {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.82rem;
    color: var(--kvc-text-muted, #6b7280);
    text-decoration: none;
    margin-top: 18px;
}
.back-to-portals:hover { color: var(--kvc-green, #1e6b2c); }

.form-label {
    font-weight: 500;
    font-size: 0.875rem;
    color: #374151;
}

.form-control:focus {
    border-color: var(--kvc-green);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 66, 0.15);
}

.btn-kvc-primary {
    background-color: var(--kvc-green);
    border-color: var(--kvc-green);
    color: #fff;
    font-weight: 500;
    padding: 10px 16px;
}

.btn-kvc-primary:hover,
.btn-kvc-primary:focus {
    background-color: var(--kvc-green-dark);
    border-color: var(--kvc-green-dark);
    color: #fff;
}

.auth-links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    margin: 4px 0 20px;
}

.auth-links a {
    color: var(--kvc-green);
    text-decoration: none;
}

.auth-links a:hover {
    text-decoration: underline;
}

.field-error {
    font-size: 0.8rem;
    color: #dc3545;
    margin-top: 4px;
    display: none;
}

.step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
}

.step-indicator .step-dot {
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
}

.step-indicator .step-dot.active {
    background: var(--kvc-green);
}

.password-toggle {
    cursor: pointer;
    color: var(--kvc-text-muted);
}

.spinner-inline {
    width: 1rem;
    height: 1rem;
    border-width: 0.15em;
}

@media (max-width: 860px) {
    .auth-shell {
        flex-direction: column;
        min-height: unset;
    }
    .auth-side {
        flex: 0 0 auto;
        padding: 32px;
    }
    .auth-main {
        padding: 32px;
    }
}

/* ===================================================================
   OTP Verification page (auth/otp_verify.php)
   =================================================================== */
.otp-input-row {
    display: flex;
    gap: 10px;
    justify-content: center;
    margin: 24px 0 8px;
}

.otp-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.4rem;
    font-weight: 600;
    border: 1.5px solid #d1d5db;
    border-radius: 10px;
    color: #1f2937;
}

.otp-box:focus {
    border-color: var(--kvc-green);
    box-shadow: 0 0 0 0.2rem rgba(46, 125, 66, 0.15);
    outline: none;
}

.otp-box.is-invalid {
    border-color: #dc3545;
}

.otp-countdown {
    text-align: center;
    font-size: 0.9rem;
    color: var(--kvc-text-muted);
    margin-bottom: 20px;
}

.otp-countdown .otp-timer {
    font-weight: 600;
    color: var(--kvc-green-dark);
}

.otp-countdown.expired .otp-timer {
    color: #dc3545;
}

.otp-resend-row {
    text-align: center;
    font-size: 0.85rem;
    margin-bottom: 22px;
}

.otp-resend-row button {
    background: none;
    border: none;
    padding: 0;
    color: var(--kvc-green);
    font-weight: 600;
    cursor: pointer;
}

.otp-resend-row button:disabled {
    color: var(--kvc-text-muted);
    cursor: default;
}

.otp-email-hint {
    text-align: center;
    font-size: 0.85rem;
    color: var(--kvc-text-muted);
    margin-bottom: 6px;
}

/* ===================================================================
   Trusted Devices (Profile > Security) — reused inside owner.css/
   settings.css contexts too, kept here since it's part of the same
   auth/security visual language.
   =================================================================== */
.trusted-device-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid #eef0f2;
}

.trusted-device-row:last-child {
    border-bottom: none;
}

.trusted-device-meta {
    font-size: 0.8rem;
    color: var(--kvc-text-muted, #6b7280);
    margin-top: 2px;
}

.trusted-device-name {
    font-weight: 600;
    color: #1f2937;
    font-size: 0.92rem;
}
