/* Sign-in page -- smis_online login.php's own styles. */
        :root {
            --bg: #0f1012;
            --surface: #16181b;
            --field: #1d2024;
            --field-hover: #22262b;
            --border: #2b2f35;
            --text: #f4f5f7;
            --text-2: #b7bcc4;
            --muted: #8a919b;
            --danger: #ff6b6b;
            --danger-bg: rgba(255, 107, 107, .10);
            --warn: #ffb547;
            --shadow: 0 1px 2px rgba(0, 0, 0, .3);
            --ring: 0 0 0 4px rgba(var(--accent-rgb, 255, 193, 7), .22);
        }
        html[data-theme="light"] {
            --bg: #f4f5f7;
            --surface: #ffffff;
            --field: #ffffff;
            --field-hover: #fafbfc;
            --border: #d9dde3;
            --text: #14171c;
            --text-2: #4a515c;
            --muted: #6b7280;
            --danger: #c62828;
            --danger-bg: #fdecec;
            --warn: #a15c00;
            --shadow: 0 1px 2px rgba(16, 24, 40, .06);
            --ring: 0 0 0 4px rgba(var(--accent-rgb, 255, 193, 7), .28);
        }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        html, body { height: 100%; }
        body {
            font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
            background: var(--bg);
            color: var(--text);
            -webkit-font-smoothing: antialiased;
        }
        a { color: inherit; }

        .auth { display: grid; grid-template-columns: minmax(0, 46fr) minmax(0, 54fr); min-height: 100vh; }

        /* ---------- Brand side ---------- */
        .brand {
            position: relative; overflow: hidden; color: #fff;
            display: flex; flex-direction: column; justify-content: space-between; padding: 40px 48px;
            background: #1a1310;
        }
        .brand-photo {
            position: absolute; inset: 0; width: 100%; height: 100%;
            object-fit: cover; object-position: 50% 18%;
            transform: scale(1.02);
        }
        .brand::after {
            content: ''; position: absolute; inset: 0;
            background:
                linear-gradient(180deg, rgba(10, 8, 6, .55) 0%, rgba(10, 8, 6, 0) 26%),
                linear-gradient(0deg, rgba(10, 8, 6, .94) 0%, rgba(10, 8, 6, .72) 34%, rgba(10, 8, 6, 0) 64%);
        }
        .brand > *:not(.brand-photo) { position: relative; z-index: 1; }

        .brand-top { display: flex; align-items: center; gap: 12px; }
        .brand-top img { width: 46px; height: 46px; border-radius: 50%; box-shadow: 0 4px 14px rgba(0, 0, 0, .45); }
        .brand-top strong { display: block; font-size: 15px; font-weight: 700; letter-spacing: .01em; }
        .brand-top span { display: block; font-size: 12px; color: rgba(255, 255, 255, .72); }

        .brand-eyebrow {
            display: inline-flex; align-items: center; gap: 8px;
            font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
            color: var(--accent, #ffc107); margin-bottom: 14px;
        }
        .brand-eyebrow::before { content: ''; width: 22px; height: 2px; border-radius: 2px; background: currentColor; }
        .brand h1 { font-size: clamp(28px, 2.6vw, 38px); line-height: 1.15; font-weight: 800; letter-spacing: -.02em; max-width: 520px; }
        .brand p.lead { margin-top: 12px; font-size: 15px; line-height: 1.6; color: rgba(255, 255, 255, .78); max-width: 480px; }

        .brand-points { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; max-width: 560px; }
        .brand-point {
            padding: 14px; border-radius: 14px;
            background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
            backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
        }
        .brand-point i { font-size: 18px; color: var(--accent, #ffc107); }
        .brand-point b { display: block; margin-top: 8px; font-size: 13px; font-weight: 700; }
        .brand-point small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.4; color: rgba(255, 255, 255, .68); }

        /* ---------- Form side ---------- */
        .panel { display: flex; flex-direction: column; padding: 28px 48px; background: var(--bg); }
        .panel-top { display: flex; justify-content: flex-end; }
        .help-link {
            display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600;
            color: var(--text-2); text-decoration: none; padding: 8px 12px; border-radius: 10px; border: 1px solid transparent;
            background: none; cursor: pointer; font-family: inherit;
        }
        .help-link:hover { border-color: var(--border); color: var(--text); }

        .panel-body { flex: 1; display: flex; align-items: center; justify-content: center; padding: 24px 0; }
        .form-wrap { width: 100%; max-width: 410px; }

        .mobile-brand { display: none; }

        .eyebrow {
            display: inline-flex; align-items: center; gap: 7px; padding: 5px 11px; border-radius: 999px;
            font-size: 12px; font-weight: 600; color: var(--text-2);
            background: var(--surface); border: 1px solid var(--border);
        }
        .eyebrow i { color: var(--accent-ink, #8f6c04); }
        html[data-theme="dark"] .eyebrow i { color: var(--accent, #ffc107); }
        .form-wrap h2 { margin-top: 18px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
        .form-wrap .sub { margin-top: 6px; font-size: 14.5px; color: var(--muted); line-height: 1.5; }

        .alert {
            display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 14px; border-radius: 12px;
            font-size: 14px; line-height: 1.45; color: var(--danger); background: var(--danger-bg);
            border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent);
        }
        .alert i { font-size: 17px; margin-top: 1px; }
        /* Success (e.g. signed out): green text too, not the error red. Only seen without SweetAlert (js/alerts.js). */
        .alert.alert-ok { color: #2fbf71; background: rgba(61,220,132,.10); border-color: rgba(61,220,132,.45); }

        form { margin-top: 26px; }
        .field { margin-bottom: 18px; }
        .field label { display: block; margin-bottom: 7px; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
        .control { position: relative; }
        .control > i.lead-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); font-size: 16px; color: var(--muted); pointer-events: none; }
        .control input {
            width: 100%; height: 50px; padding: 0 46px 0 42px; border-radius: 12px;
            font-family: inherit; font-size: 15.5px; font-weight: 500; color: var(--text);
            background: var(--field); border: 1px solid var(--border); box-shadow: var(--shadow);
            transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
        }
        .control input::placeholder { color: var(--muted); opacity: .8; }
        .control input:hover { background: var(--field-hover); }
        .control input:focus { outline: none; border-color: var(--accent, #ffc107); box-shadow: var(--ring); }
        .control input:focus + .lead-icon, .control:focus-within > i.lead-icon { color: var(--accent-ink, #8f6c04); }
        html[data-theme="dark"] .control:focus-within > i.lead-icon { color: var(--accent, #ffc107); }
        .reveal {
            position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
            width: 38px; height: 38px; border-radius: 9px; border: 0; background: transparent; color: var(--muted);
            font-size: 17px; cursor: pointer;
        }
        .reveal:hover { color: var(--text); background: color-mix(in srgb, var(--text) 7%, transparent); }
        .reveal:focus-visible { outline: none; box-shadow: var(--ring); }
        .caps { display: none; align-items: center; gap: 6px; margin-top: 7px; font-size: 12.5px; font-weight: 600; color: var(--warn); }
        .caps.show { display: flex; }

        .row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 24px; }
        .check { display: inline-flex; align-items: center; gap: 9px; font-size: 14px; color: var(--text-2); cursor: pointer; user-select: none; }
        .check input { width: 17px; height: 17px; accent-color: var(--accent, #ffc107); cursor: pointer; }
        .link-btn {
            border: 0; background: none; padding: 2px; cursor: pointer; font: inherit; font-size: 14px; font-weight: 600;
            color: var(--accent-ink, #8f6c04); text-decoration: none;
        }
        html[data-theme="dark"] .link-btn { color: var(--accent, #ffc107); }
        .link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
        .link-btn:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 6px; }

        .btn-primary {
            width: 100%; height: 52px; border: 0; border-radius: 12px; cursor: pointer;
            display: inline-flex; align-items: center; justify-content: center; gap: 10px;
            font-family: inherit; font-size: 15.5px; font-weight: 700; color: #111;
            background: var(--accent, #ffc107);
            box-shadow: 0 8px 22px rgba(var(--accent-rgb, 255, 193, 7), .28), inset 0 -2px 0 rgba(0, 0, 0, .10);
            transition: transform .12s ease, box-shadow .15s ease, filter .15s ease;
        }
        .btn-primary:hover { filter: brightness(1.04); box-shadow: 0 10px 26px rgba(var(--accent-rgb, 255, 193, 7), .36), inset 0 -2px 0 rgba(0, 0, 0, .10); }
        .btn-primary:active { transform: translateY(1px); }
        .btn-primary:focus-visible { outline: none; box-shadow: var(--ring); }
        .btn-primary .spin { display: none; width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(0, 0, 0, .25); border-top-color: #111; animation: spin .7s linear infinite; }
        .btn-primary.loading { pointer-events: none; filter: saturate(.85); }
        .btn-primary.loading .spin { display: inline-block; }
        .btn-primary.loading .arrow { display: none; }
        @keyframes spin { to { transform: rotate(360deg); } }

        .note {
            display: flex; gap: 10px; align-items: flex-start; margin-top: 22px; padding: 12px 14px; border-radius: 12px;
            font-size: 13px; line-height: 1.5; color: var(--muted); background: var(--surface); border: 1px solid var(--border);
        }
        .note i { color: var(--text-2); margin-top: 1px; }

        .trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 26px; font-size: 12.5px; color: var(--muted); }
        .trust span { display: inline-flex; align-items: center; gap: 6px; }
        .trust i { color: var(--text-2); }

        .panel-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); }

        /* Forgot password */
        dialog.help {
            width: min(440px, calc(100vw - 32px)); margin: auto; padding: 0; border: 1px solid var(--border); border-radius: 18px;
            background: var(--surface); color: var(--text); box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
        }
        dialog.help::backdrop { background: rgba(8, 9, 11, .55); backdrop-filter: blur(3px); }
        dialog.help[open] { animation: pop .18s cubic-bezier(.2, .8, .2, 1); }
        @keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }
        .help-body { padding: 24px; }
        .help-icon {
            width: 46px; height: 46px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 21px; color: #111;
            background: var(--accent, #ffc107);
        }
        .help-body h3 { margin-top: 14px; font-size: 19px; font-weight: 800; }
        .help-body p { margin-top: 8px; font-size: 14.5px; line-height: 1.55; color: var(--text-2); }
        .help-body ol { margin: 12px 0 0 18px; font-size: 14px; line-height: 1.7; color: var(--text-2); }
        .help-body ol b { color: var(--text); }
        .help-actions { display: flex; justify-content: flex-end; padding: 0 24px 22px; }
        .help-actions button {
            height: 42px; padding: 0 18px; border-radius: 10px; border: 1px solid var(--border); cursor: pointer;
            font-family: inherit; font-size: 14px; font-weight: 600; color: var(--text); background: var(--field);
        }
        .help-actions button:hover { border-color: var(--accent, #ffc107); }

        /* Entrance */
        .rise { animation: rise .5s cubic-bezier(.2, .8, .2, 1) both; }
        .rise.d1 { animation-delay: .04s; } .rise.d2 { animation-delay: .08s; } .rise.d3 { animation-delay: .12s; }
        @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
        @media (prefers-reduced-motion: reduce) { .rise, dialog.help[open] { animation: none; } }

        /* ---------- Smaller screens ---------- */
        @media (max-width: 1100px) {
            .brand { padding: 32px 34px; }
            .brand-points { grid-template-columns: 1fr; max-width: 360px; }
            .panel { padding: 24px 34px; }
        }
        @media (max-width: 860px) {
            .auth { grid-template-columns: minmax(0, 1fr); }
            .brand { display: none; }
            .panel { min-height: 100vh; min-width: 0; padding: 18px 18px 22px; }
            .panel-top { justify-content: space-between; align-items: center; }
            .mobile-brand { display: flex; align-items: center; gap: 10px; }
            .mobile-brand img { width: 38px; height: 38px; border-radius: 50%; }
            .mobile-brand strong { display: block; font-size: 14px; font-weight: 700; }
            .mobile-brand span { display: block; font-size: 11.5px; color: var(--muted); }
            .panel-body { align-items: flex-start; padding-top: 34px; }
            .form-wrap h2 { font-size: 25px; }
            .control input { font-size: 16px; }
            .panel-foot { justify-content: center; text-align: center; }
        }
