*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body.sl-login-page { font-family: 'Segoe UI', system-ui, sans-serif; }

/* ── Split wrapper ── */
.sl-split {
    display: flex; min-height: 100vh;
}

/* ── Brand panel (left) ── */
.sl-brand {
    flex: 0 0 44%; background: linear-gradient(160deg, #0d1f0d 0%, #1a3a1a 50%, #2d5a2d 100%);
    padding: 48px 40px; display: flex; flex-direction: column;
    justify-content: center; position: relative; overflow: hidden;
}
.sl-brand::before {
    content: ''; position: absolute; top: -60px; right: -60px;
    width: 260px; height: 260px; background: rgba(255,255,255,0.03); border-radius: 50%;
}
.sl-brand::after {
    content: ''; position: absolute; bottom: -80px; left: -40px;
    width: 200px; height: 200px; background: rgba(255,255,255,0.02); border-radius: 50%;
}
.sl-logo-box {
    display: flex; align-items: center; gap: 12px; margin-bottom: 40px;
}
.sl-logo-icon {
    width: 46px; height: 46px; background: rgba(255,255,255,0.15);
    border-radius: 12px; display: flex; align-items: center;
    justify-content: center; font-size: 22px;
}
.sl-brand-name { color: #fff; font-size: 22px; font-weight: 700; }
.sl-brand h2 {
    color: #fff; font-size: 28px; font-weight: 700; line-height: 1.3;
    margin-bottom: 14px;
}
.sl-brand-desc { color: rgba(255,255,255,.6); font-size: 15px; line-height: 1.6; margin-bottom: 40px; }
.sl-features { display: flex; flex-direction: column; gap: 16px; }
.sl-feature {
    display: flex; align-items: center; gap: 14px;
}
.sl-feature-icon {
    width: 38px; height: 38px; background: rgba(255,255,255,0.1);
    border-radius: 10px; display: flex; align-items: center;
    justify-content: center; color: #7dd87d; font-size: 16px; flex-shrink: 0;
}
.sl-feature-text { color: rgba(255,255,255,.8); font-size: 14px; }
.sl-feature-text strong { color: #fff; display: block; font-size: 14px; }

/* ── Form panel (right) ── */
.sl-form-panel {
    flex: 1; background: var(--color-surface, #fff); display: flex;
    align-items: center; justify-content: center;
    padding: 40px 32px;
}
.sl-form-inner { width: 100%; max-width: 400px; }

/* Heading */
.sl-form-title { font-size: 26px; font-weight: 700; color: #1a2e1a; margin-bottom: 6px; }
.sl-form-sub { font-size: 14px; color: var(--color-text-muted, #888); margin-bottom: 28px; }

/* Input rows */
.sl-input-row {
    position: relative; margin-bottom: 6px;
    border: 1.5px solid var(--color-border, #e0e0e0); border-radius: 10px;
    display: flex; align-items: center; padding: 0 14px;
    transition: border-color .2s;
}
.sl-input-row:focus-within { border-color: #2d7a3a; }
.sl-input-row.sl-error   { border-color: #dc3545; }
.sl-input-row.sl-success { border-color: #2d7a3a; }
.sl-input-icon { color: #aaa; font-size: 16px; flex-shrink: 0; margin-right: 10px; }
.sl-input-row input {
    flex: 1; border: none; outline: none; padding: 13px 0;
    font-size: 14px; color: var(--color-text, #222); background: transparent;
}
.sl-toggle-btn {
    background: none; border: none; cursor: pointer;
    color: #aaa; font-size: 15px; padding: 0; flex-shrink: 0;
}
.sl-field-msg { font-size: 11px; color: #dc3545; margin-bottom: 12px; min-height: 16px; padding-left: 2px; }
.sl-field-msg.ok { color: #2d7a3a; }

/* Options row */
.sl-options {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
}
.sl-remember { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--color-text-muted, #555); cursor: pointer; }
.sl-remember input[type=checkbox] { accent-color: #2d7a3a; }
.sl-forgot { font-size: 13px; color: #2d7a3a; text-decoration: none; cursor: pointer; }
.sl-forgot:hover { text-decoration: underline; }

/* Primary button */
.sl-btn-primary {
    width: 100%; padding: 14px; background: #1a2e1a; color: #fff;
    border: none; border-radius: 10px; font-size: 15px;
    font-weight: 600; cursor: pointer; transition: background .2s;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 20px;
}
.sl-btn-primary:hover { background: #2d7a3a; }

/* Switch row */
.sl-switch-row { text-align: center; font-size: 14px; color: var(--color-text-muted, #888); }
.sl-switch-row a { color: #2d7a3a; text-decoration: none; font-weight: 600; }
.sl-switch-row a:hover { text-decoration: underline; }

/* Reset form extras */
.sl-back-link {
    display: inline-flex; align-items: center; gap: 6px;
    color: #2d7a3a; font-size: 13px; text-decoration: none;
    cursor: pointer; margin-bottom: 24px;
}
.sl-back-link:hover { text-decoration: underline; }

/* OTP row */
.sl-otp-btns {
    display: flex; gap: 10px; margin-bottom: 6px;
}
.sl-otp-btn {
    flex: 1; padding: 11px; border: 1.5px solid #e0e0e0;
    border-radius: 10px; font-size: 13px; font-weight: 600;
    background: var(--color-surface, #fff); color: var(--color-text-muted, #555); cursor: pointer; transition: all .2s;
}
.sl-otp-btn:not(:disabled):hover { border-color: #2d7a3a; color: #2d7a3a; }
.sl-otp-btn:disabled { opacity: .45; cursor: not-allowed; }
.sl-otp-btn.verify { background: #eaf4ea; color: #2d7a3a; border-color: #c8e8c8; }

/* ── Tablet landscape (≤ 1024px) ── */
@media (max-width: 1024px) {
    .sl-brand { flex: 0 0 42%; padding: 40px 32px; }
    .sl-brand h2 { font-size: 24px; }
    .sl-brand-desc { font-size: 14px; margin-bottom: 32px; }
    .sl-features { gap: 14px; }
    .sl-form-panel { padding: 36px 28px; }
    .sl-form-inner { max-width: 380px; }
}

/* ── Tablet portrait (≤ 820px) — stack columns, brand still visible ── */
@media (max-width: 820px) and (min-width: 641px) {
    .sl-split { flex-direction: column; min-height: 100vh; }

    .sl-brand {
        flex: none;
        padding: 32px 36px 36px;
        min-height: auto;
    }
    .sl-logo-box { margin-bottom: 18px; }
    .sl-brand h2 { font-size: 24px; margin-bottom: 10px; }
    .sl-brand-desc { font-size: 14px; margin-bottom: 24px; max-width: 560px; }

    /* Features: row layout on tablet for compactness */
    .sl-features {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 14px 18px;
    }
    .sl-feature {
        flex: 1 1 calc(33.333% - 18px);
        min-width: 200px;
    }
    .sl-feature-text { font-size: 13px; }

    .sl-form-panel { padding: 36px 28px; }
    .sl-form-inner { max-width: 480px; }
}

/* ──────────────────────────────────────────────────────────────
   MOBILE REDESIGN (≤ 640px) — app-style: hero header + form sheet
   ────────────────────────────────────────────────────────────── */
@media (max-width: 640px) {
    body.sl-login-page { background: #0d1f0d; }

    .sl-split {
        flex-direction: column;
        min-height: 100vh;
        min-height: 100dvh;
    }

    /* Compact green hero — logo + tagline only */
    .sl-brand {
        flex: none;
        padding: 28px 22px 56px;
        text-align: left;
    }
    .sl-brand::before { width: 180px; height: 180px; top: -50px; right: -50px; }
    .sl-brand::after  { display: none; }

    .sl-logo-box { margin-bottom: 18px; gap: 10px; }
    .sl-logo-icon { width: 40px; height: 40px; font-size: 20px; border-radius: 10px; }
    .sl-brand-name { font-size: 19px; }

    .sl-brand h2 {
        font-size: 22px;
        line-height: 1.3;
        margin-bottom: 6px;
    }
    .sl-brand h2 br { display: none; }
    .sl-brand-desc { display: none; }
    .sl-features { display: none; }

    /* Form panel becomes an overlapping sheet */
    .sl-form-panel {
        flex: 1;
        margin-top: -28px;
        padding: 26px 20px 36px;
        background: var(--color-surface, #fff);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -6px 20px rgba(0,0,0,.08);
        position: relative;
        z-index: 1;
    }
    .sl-form-inner { max-width: 100%; }

    .sl-form-title { font-size: 22px; margin-bottom: 4px; }
    .sl-form-sub { font-size: 13px; margin-bottom: 22px; }

    /* Inputs — 16px to prevent iOS zoom, taller touch target */
    .sl-input-row {
        padding: 0 14px;
        border-radius: 12px;
        margin-bottom: 4px;
    }
    .sl-input-row input { padding: 14px 0; font-size: 16px; }
    .sl-input-icon { font-size: 16px; margin-right: 10px; }
    .sl-toggle-btn {
        font-size: 17px;
        padding: 8px;
        min-width: 36px;
        min-height: 36px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .sl-field-msg { font-size: 11.5px; margin-bottom: 10px; }

    .sl-options {
        gap: 12px;
        margin-bottom: 18px;
        flex-wrap: wrap;
    }
    .sl-remember, .sl-forgot { font-size: 13.5px; }

    .sl-btn-primary {
        padding: 15px;
        font-size: 15.5px;
        min-height: 50px;
        border-radius: 12px;
        margin-bottom: 18px;
    }
    .sl-switch-row { font-size: 14px; }

    /* Reset-password OTP buttons stack on phones */
    .sl-otp-btns { flex-direction: column; gap: 8px; }
    .sl-otp-btn { padding: 13px; font-size: 14px; min-height: 46px; border-radius: 12px; }

    .sl-back-link { font-size: 13.5px; margin-bottom: 18px; padding: 6px 0; }
}

/* ── Small mobile (≤ 380px) ── */
@media (max-width: 380px) {
    .sl-brand { padding: 24px 18px 52px; }
    .sl-brand h2 { font-size: 20px; }
    .sl-form-panel { padding: 22px 16px 32px; }
    .sl-form-title { font-size: 20px; }

    .sl-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* ── Landscape phones — keep hero tiny so form stays in view ── */
@media (max-height: 500px) and (orientation: landscape) and (max-width: 900px) {
    .sl-split { min-height: auto; }
    .sl-brand { padding: 18px 24px 36px; }
    .sl-brand h2 { font-size: 18px; margin-bottom: 4px; }
    .sl-form-panel { padding: 22px 20px 28px; margin-top: -20px; }
}
