/* ============================================================================
   login.css  —  depends on global_theme.css being loaded first
============================================================================ */

/* ── RESET ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────────── */
:root {
    --fh : 'Syne', sans-serif;
    --fb : 'Plus Jakarta Sans', sans-serif;

    /* Green aliases that pull from global_theme.css */
    --g  : var(--primary-color);      /* #4caf50 */
    --gd : var(--primary-dark);       /* #047857 */
    --gl : var(--primary-lighter);    /* #34d399 */
    --g08: rgba(76,175,80,.08);
    --g12: rgba(76,175,80,.12);
    --g22: rgba(76,175,80,.22);
    --g30: rgba(76,175,80,.30);
}

/* ── BASE ──────────────────────────────────────────────────────────────────── */
html, body {
    height: 100%;
    min-height: 100%;
    font-family: var(--fb);
    background: #eef4ee;
    overflow: auto;   /* was hidden — allow scroll when viewport is short */
}

/* ── CANVAS ────────────────────────────────────────────────────────────────── */
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; }

/* ══════════════════════════════════════════════════════════════════════════════
   PAGE GRID
   Two equal columns — left content, right form card.
   No dead space: both panels fill the viewport height equally.
══════════════════════════════════════════════════════════════════════════════ */
.page {
    position: relative;
    z-index: 2;
    display: grid;
    /* Left text panel 51%, right form panel 49% */
    grid-template-columns: 51fr 49fr;
    min-height: 100vh;   /* was height:100vh — now can grow taller if needed */
}

/* ══════════════════════════════════════════════════════════════════════════════
   LEFT PANEL
══════════════════════════════════════════════════════════════════════════════ */
.lp {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 36px;                         /* tighter gap between hero and features */
    padding: 48px 40px 48px 52px;      /* right padding reduced — text closer to divider */
    position: relative;
}

/* subtle right-edge divider */
.lp::after {
    content: '';
    position: absolute;
    right: 0; top: 0; bottom: 0;
    width: 1px;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(76,175,80,.28) 25%,
        rgba(76,175,80,.28) 75%,
        transparent 100%
    );
}

/* ── HERO ── */
.hero {
    display: flex;
    flex-direction: column;
    gap: 0;                            /* spacing controlled per-child below */
}

.hero-label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--g);
    margin-bottom: 20px;               /* space before heading */
}
.hero-label-bar {
    display: inline-block;
    width: 28px; height: 2px;
    background: linear-gradient(to right, var(--g), var(--gl));
    border-radius: 2px;
}

.hero-h1 {
    font-family: var(--fh);
    font-size: clamp(36px, 3vw, 48px); /* comfortable range — not too big, not tiny */
    font-weight: 800;
    line-height: 1.12;                 /* open line height */
    letter-spacing: -.02em;
    color: #152015;
    margin-bottom: 18px;               /* space before paragraph */
}
.hero-h1 .accent {
    background: linear-gradient(120deg, var(--g) 0%, var(--gl) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-p {
    font-size: 15px;
    line-height: 1.78;
    color: #4a604a;
    font-weight: 400;
    max-width: 340px;                  /* tighter — stays close to divider */
    margin-bottom: 24px;
}

.trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background: var(--g08);
    border: 1px solid var(--g22);
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
    color: #2d6b30;
    width: fit-content;
}
.trust-badge i { font-size: 10px; color: var(--g); }

/* ── FEATURE LIST ── */
.feat-list {
    display: flex;
    flex-direction: column;
    gap: 14px;                         /* space between each feature row */
}
.feat-row { display: flex; align-items: center; gap: 14px; }

.feat-icon-wrap {
    width: 32px; height: 32px;
    border-radius: 8px;
    flex-shrink: 0;
    background: var(--g08);
    border: 1px solid var(--g22);
    display: flex;
    align-items: center;
    justify-content: center;
}
.feat-icon-wrap i { font-size: 13px; color: var(--g); }

.feat-text { font-size: 13.5px; color: #4a604a; font-weight: 400; line-height: 1.4; }

/* ── LEFT PANEL ANIMATIONS ── */
.hero       { animation: slideUp   .8s .10s ease both; }
.feat-list  { animation: slideUp   .8s .22s ease both; }

/* ══════════════════════════════════════════════════════════════════════════════
   RIGHT PANEL
══════════════════════════════════════════════════════════════════════════════ */
.rp {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    padding: 36px 44px 36px 40px;      /* balanced — card fills full column width */
    background: rgba(255,255,255,.75);
    backdrop-filter: blur(32px);
    -webkit-backdrop-filter: blur(32px);
    border-left: 1px solid rgba(76,175,80,.14);
    animation: slideLeft .7s .05s ease both;
    box-shadow: -4px 0 40px rgba(0,0,0,.05);
}

/* ── FORM CARD ── */
.form-card {
    background: #fff;
    border-radius: 22px;
    padding: clamp(24px, 3vh, 40px) 36px;
    box-shadow:
        0 2px 4px rgba(0,0,0,.04),
        0 8px 24px rgba(0,0,0,.07),
        0 24px 56px rgba(0,0,0,.06),
        0 0 0 1px rgba(76,175,80,.10);
    position: relative;
    overflow: hidden;
}

/* top green accent stripe */
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--g) 0%, var(--gl) 60%, transparent 100%);
    border-radius: 22px 22px 0 0;
}

/* corner glow */
.form-card::after {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 160px; height: 160px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(76,175,80,.07) 0%, transparent 70%);
    pointer-events: none;
}

/* ── CARD LOGO ROW ── */
.card-logo-row {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: clamp(12px, 2vh, 24px);
    padding-bottom: clamp(10px, 1.5vh, 20px);
    border-bottom: 1px solid #f0f4f0;
}

.card-logo-wrap {
    position: relative;
    flex-shrink: 0;
    width: 60px; height: 60px;
}
.card-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--g30), rgba(52,211,153,.15));
    animation: logoPulse 3s 1s ease-in-out infinite;
}
.card-logo-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 11px;
    background: #fff;
    box-shadow:
        0 2px 12px rgba(76,175,80,.18),
        0 0 0 1px rgba(76,175,80,.20);
}

.card-logo-img {
    position: relative;
    z-index: 1;
    width: 100%; height: 100%;
    object-fit: contain;
    border-radius: 11px;
    padding: 7px;
}

.card-logo-text .ct1 {
    font-family: var(--fh);
    font-size: 15px; font-weight: 800;
    letter-spacing: .1em; text-transform: uppercase;
    color: #1a2e1a;
}
.card-logo-text .ct2 {
    font-size: 11px; color: #7a967a;
    margin-top: 3px; letter-spacing: .03em;
}

/* ── FORM HEADER ── */
.form-hd { margin-bottom: clamp(12px, 2vh, 22px); }

.form-hd-tag {
    font-size: 11px; font-weight: 700;
    letter-spacing: .18em; text-transform: uppercase;
    color: var(--g); margin-bottom: 6px;
}
.form-hd-title {
    font-family: var(--fh);
    font-size: 23px; font-weight: 800;
    color: #152015; margin-bottom: 5px; line-height: 1.2;
}
.form-hd-sub { font-size: 13px; color: #6b7d6b; font-weight: 400; }

/* ── ALERTS ── */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 11px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: clamp(10px, 1.5vh, 20px);
    animation: shakeIn .4s ease;
}
.alert-error   { background: #fff5f5; border: 1px solid #fecaca; color: #c0392b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.alert i { margin-top: 1px; font-size: 13px; flex-shrink: 0; }

/* ── LOGIN FORM ── */
.login-form { display: flex; flex-direction: column; gap: clamp(10px, 1.5vh, 16px); }

.field { display: flex; flex-direction: column; gap: 7px; }

.field-label {
    font-size: 11.5px; font-weight: 700;
    color: #3d533d; letter-spacing: .06em; text-transform: uppercase;
}

.input-shell {
    position: relative;
    border-radius: 11px;
    background: #f7fbf7;
    border: 1.5px solid #d4e8d4;
    transition: border-color .2s, box-shadow .2s, background .2s;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.input-shell:focus-within {
    border-color: var(--g);
    background: #fff;
    box-shadow: 0 0 0 4px var(--g12), 0 2px 8px rgba(76,175,80,.10);
}
.input-shell:focus-within .shell-icon { color: var(--g); }

.shell-icon {
    position: absolute; left: 14px;
    color: #9ab89a; font-size: 13px;
    pointer-events: none;
    transition: color .2s;
    z-index: 1;
}

.field-input {
    width: 100%;
    background: transparent;
    border: none; outline: none;
    color: #1a2e1a;
    font-family: var(--fb);
    font-size: 14px; font-weight: 500;
    padding: 13px 14px 13px 41px;
    line-height: 1;
}
.field-input::placeholder { color: #aac2aa; font-weight: 400; }
.field-input[type="password"] { padding-right: 44px; letter-spacing: .05em; }
.field-input[type="password"]::placeholder { letter-spacing: 0; }

/* password strength bar */
.strength-bar {
    height: 3px; border-radius: 2px; margin-top: 5px;
    background: #e8f0e8; overflow: hidden; display: none;
}
.strength-fill {
    height: 100%; border-radius: 2px; width: 0%;
    transition: width .3s ease, background .3s ease;
}

.toggle-btn {
    position: absolute; right: 12px;
    background: none; border: none; cursor: pointer;
    color: #9ab89a; font-size: 14px; padding: 4px;
    display: flex; align-items: center;
    transition: color .2s;
}
.toggle-btn:hover { color: var(--g); }

/* ── REMEMBER / FORGOT ROW ── */
.form-foot-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: -2px;
}
.remember-row { display: flex; align-items: center; gap: 7px; cursor: pointer; }
.remember-row input[type="checkbox"] {
    width: 15px; height: 15px; cursor: pointer;
    accent-color: var(--g); border-radius: 4px;
}
.remember-row span { font-size: 12.5px; color: #6b7d6b; font-weight: 500; }

.forgot-link {
    font-size: 12.5px; color: var(--g);
    font-weight: 600; text-decoration: none;
    transition: opacity .2s;
}
.forgot-link:hover { opacity: .75; }

/* ── SUBMIT BUTTON ── */
.btn-login {
    width: 100%;
    padding: 14px 24px;
    border-radius: 12px;
    border: none; cursor: pointer;
    font-family: var(--fh);
    font-size: 14px; font-weight: 700;
    letter-spacing: .06em; text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, var(--g) 0%, var(--gd) 100%);
    box-shadow:
        0 4px 20px rgba(76,175,80,.38),
        0 1px 0 rgba(255,255,255,.15) inset,
        0 -1px 0 rgba(0,0,0,.10) inset;
    transition: transform .15s, box-shadow .15s, opacity .15s;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}
.btn-login::before {
    content: '';
    position: absolute; inset: 0;
    background: linear-gradient(to right, transparent, rgba(255,255,255,.12), transparent);
    transform: translateX(-100%);
    transition: transform .55s ease;
}
.btn-login:hover::before  { transform: translateX(100%); }
.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(76,175,80,.46), 0 1px 0 rgba(255,255,255,.15) inset;
}
.btn-login:active   { transform: translateY(0); box-shadow: 0 2px 10px rgba(76,175,80,.35); }
.btn-login:disabled { opacity: .62; cursor: not-allowed; transform: none; }

.btn-inner { display: flex; align-items: center; justify-content: center; gap: 9px; }
.btn-arrow { transition: transform .2s; }
.btn-login:hover .btn-arrow { transform: translateX(3px); }

/* ── SPINNER ── */
.spinner {
    width: 15px; height: 15px;
    border: 2px solid rgba(255,255,255,.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .65s linear infinite;
    display: inline-block;
}

/* ── DIVIDER ── */
.divider {
    display: flex; align-items: center; gap: 12px;
    margin: clamp(10px, 1.5vh, 16px) 0 0;
}
.divider-line { flex: 1; height: 1px; background: #edf2ed; }
.divider-text { font-size: 11px; color: #9ab89a; font-weight: 500; white-space: nowrap; }

/* ── SECURE ROW ── */
.secure-row {
    display: flex; align-items: center;
    justify-content: center; gap: 16px;
    padding-top: 14px;
}
.sec-item {
    display: flex; align-items: center; gap: 5px;
    font-size: 11px; color: #9ab89a; font-weight: 500;
}
.sec-item i { font-size: 9px; color: var(--g); }

/* ── CARD FOOTER ── */
.card-footer { text-align: center; margin-top: 16px; }

/* ══════════════════════════════════════════════════════════════════════════════
   KEYFRAMES
══════════════════════════════════════════════════════════════════════════════ */
@keyframes slideDown  { from { opacity:0; transform:translateY(-16px); } to { opacity:1; transform:translateY(0); } }
@keyframes slideUp    { from { opacity:0; transform:translateY(16px);  } to { opacity:1; transform:translateY(0); } }
@keyframes slideLeft  { from { opacity:0; transform:translateX(20px);  } to { opacity:1; transform:translateX(0); } }
@keyframes shakeIn    { 0%{opacity:0;transform:translateX(-8px)} 40%{transform:translateX(5px)} 70%{transform:translateX(-3px)} 100%{opacity:1;transform:translateX(0)} }
@keyframes spin       { to { transform: rotate(360deg); } }
@keyframes logoPulse  { 0%,100%{ opacity:.7; transform:scale(1); } 50%{ opacity:1; transform:scale(1.04); } }

/* ══════════════════════════════════════════════════════════════════════════════
   RESPONSIVE
══════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
    .page { grid-template-columns: 1fr; overflow-y: auto; }
    .lp   { display: none; }
    .rp   {
        min-height: 100vh;
        border-left: none;
        padding: 48px 24px;
        justify-content: center;
        background: rgba(255,255,255,.95);
    }
    html, body { overflow: auto; }
}

@media (max-width: 480px) {
    .rp        { padding: 40px 16px; }
    .form-card { padding: 32px 20px; }
    .form-hd-title { font-size: 20px; }
}

/* ── SHORT VIEWPORT FIX (100% zoom on laptop, 768–900px tall screens) ────── */
@media (max-height: 820px) {
    .rp            { padding-top: 24px; padding-bottom: 24px; justify-content: flex-start; }
    .form-card     { padding: clamp(18px, 2.5vh, 32px) 32px; }
    .card-logo-row { margin-bottom: 10px; padding-bottom: 10px; }
    .form-hd       { margin-bottom: 10px; }
    .form-hd-title { font-size: 20px; }
    .form-hd-sub   { display: none; }
    .login-form    { gap: 10px; }
    .field-input   { padding-top: 10px; padding-bottom: 10px; }
    .btn-login     { padding: 11px 24px; }
    .divider       { margin-top: 10px; }
    .secure-row    { padding-top: 10px; }
    .lp            { gap: 20px; padding: 32px 40px 32px 52px; }
}

@media (max-height: 680px) {
    .feat-list     { display: none; }
    .trust-badge   { display: none; }
    .hero-p        { margin-bottom: 0; }
    .card-logo-row { display: none; }
    .form-card     { padding: 20px 28px; }
}