/* ==========================================================================
   NCIP Portal - Authentication pages (login, sign up, forgot password)
   Loaded after each page's own styles so that all three share one card
   size, logo, field style, button and mobile layout.
   ========================================================================== */

:root {
    --auth-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --auth-card-w: 1040px;
    --auth-field-h: 48px;
}

body {
    font-family: var(--auth-font);
    -webkit-font-smoothing: antialiased;
    align-items: center;
    padding: clamp(14px, 3vw, 32px);
}

/* ---- Back button (same on every auth page) ---- */
body .back-home {
    position: fixed;
    top: 20px;
    left: 20px;
    z-index: 20;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 10px 16px;
    border: 1px solid var(--border, #d8e6dc);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.94);
    color: var(--green-deep, #1e4d2b);
    font-family: var(--auth-font);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    box-shadow: 0 6px 20px rgba(30, 77, 43, 0.10);
    backdrop-filter: blur(8px);
    transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
body .back-home:hover { transform: translateX(-3px); background: #fff; box-shadow: 0 8px 24px rgba(30, 77, 43, 0.16); }
body .back-home:focus-visible { outline: 3px solid rgba(76, 175, 110, 0.35); outline-offset: 3px; }

/* ---- Card ---- */
body :is(.login-card, .register-card) {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: var(--auth-card-w);
    border-radius: 20px;
}

body .left-panel {
    flex: 0 0 40%;
    min-height: 480px;
}
body .left-title { font-size: clamp(22px, 2.6vw, 30px); }
body .left-sub { font-family: var(--auth-font); font-weight: 400; }

body .right-panel {
    flex: 1;
    min-width: 0;
    justify-content: center;
    padding: clamp(28px, 4vw, 48px) clamp(20px, 4.5vw, 52px);
}

/* ---- Logo + heading ---- */
body .logo-wrap { margin-bottom: 18px; }
body .logo { width: clamp(72px, 18vw, 92px); height: auto; }
body .brand-name { margin-bottom: 26px; }
body .brand-name h2 { font-family: var(--auth-font); font-size: 14px; font-weight: 700; letter-spacing: 1.2px; }
body .brand-name p { font-family: var(--auth-font); font-size: 13px; font-weight: 400; letter-spacing: 0; }

/* ---- Form width: narrow for login / forgot, wide for sign up ---- */
body :is(.login-form) { max-width: 340px; width: 100%; }
body .register-form { max-width: 560px; width: 100%; }

/* ---- Labels and fields ---- */
body .form-label {
    font-family: var(--auth-font);
    font-size: 11.5px;
    font-weight: 600;
    letter-spacing: 0.8px;
    margin-bottom: 7px;
}
body .input-group input,
body .input-group select {
    width: 100%;
    min-height: var(--auth-field-h);
    padding: 12px 44px 12px 16px;
    border: 1.5px solid var(--border, #d8e6dc);
    border-radius: 12px;
    background-color: var(--cream, #f9f6ef);
    color: var(--text-dark, #1a2e1f);
    font-family: var(--auth-font);
    font-size: 14.5px;
    font-weight: 400;
    line-height: 1.3;
}
body .input-group input::placeholder { color: #a5b3aa; font-weight: 400; }
body .input-group input:focus,
body .input-group select:focus {
    border-color: var(--green-mid, #2e7d46);
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(46, 125, 70, 0.12);
    outline: none;
}
body .input-group select { padding-right: 34px; text-overflow: ellipsis; }
body .form-row.triple .input-group select { padding-left: 12px; padding-right: 26px; font-size: 13.5px; }
body .input-group.has-icon input,
body .input-group.has-icon select { padding-left: 16px; }

/* ---- Primary button ---- */
body :is(.btn-login, .btn-register) {
    width: 100%;
    min-height: 50px;
    padding: 13px 20px;
    border-radius: 12px;
    font-family: var(--auth-font);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* ---- Footer links ---- */
body .divider span,
body .signup-text,
body .signin-text { font-family: var(--auth-font); }
body :is(.signup-text, .signin-text) { font-size: 13.5px; }

/* ---- Messages ---- */
body :is(.error-box, .alert-box, .field-error, .file-note, .captcha-error) { font-family: var(--auth-font); }

/* ---- Narrow desktop / tablet: keep the back button clear of the card ---- */
@media (max-width: 1100px) {
    body { align-items: flex-start; padding-top: 72px; }
}

/* ---- Tablet ---- */
@media (max-width: 900px) {
    body .left-panel { flex-basis: 36%; }
}

/* ---- Phone: image banner on top, short, then the form ---- */
@media (max-width: 720px) {
    body { align-items: flex-start; padding: 70px 14px 24px; }
    body :is(.login-card, .register-card) { flex-direction: column; max-width: 560px; margin: 0 auto; }
    body .left-panel { flex: 0 0 auto; min-height: 150px; height: 150px; }
    body .left-content { padding: 18px 20px; }
    body .left-badge { margin-bottom: 8px; padding: 5px 11px; font-size: 10px; letter-spacing: 1.2px; }
    body .left-title { font-size: 20px; margin-bottom: 0; }
    body .left-title br { display: none; }
    body .left-divider,
    body .left-sub { display: none; }
    body .right-panel { padding: 26px 20px 28px; }
    body .back-home { top: 14px; left: 14px; padding: 9px 14px; }
    body .login-form, body .register-form { max-width: 100%; }
    /* 16px stops iOS from zooming into fields */
    body .input-group input,
    body .input-group select { font-size: 16px; }
}

@media (max-width: 460px) {
    body { padding: 64px 10px 18px; }
    body .right-panel { padding: 22px 16px 24px; }
}

@media (prefers-reduced-motion: reduce) {
    body *, body *::before, body *::after { animation: none !important; transition: none !important; }
}
