/* ============================================================
   NRestro — Login page redesign
   ============================================================ */
:root {
    --auth-bg: #f4f6fb;
    --auth-surface: #ffffff;
    --auth-border: #e3e8ee;
    --auth-text: #0f172a;
    --auth-muted: #64748b;
    --auth-primary: #2563eb;
    --auth-primary-dark: #1d4ed8;
    --auth-primary-soft: #dbeafe;
    --auth-success: #16a34a;
    --auth-success-soft: #dcfce7;
    --auth-danger: #dc2626;
    --auth-danger-soft: #fee2e2;
    --auth-shadow: 0 1px 2px rgba(15,23,42,.04), 0 10px 30px rgba(15,23,42,.08);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body {
    margin: 0; background: var(--auth-bg); color: var(--auth-text);
    font-family: 'Source Sans Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px; line-height: 1.45;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}

/* ---------- Two-pane shell ---------- */
.auth-shell {
    height: 100vh; display: grid;
    grid-template-columns: 1fr;
    overflow: hidden;
}
@media (min-width: 992px) {
    .auth-shell { grid-template-columns: 5fr 7fr; }
}
@media (min-width: 1400px) {
    .auth-shell { grid-template-columns: 1fr 1fr; }
}

/* ---------- Brand panel ---------- */
.auth-brand {
    position: relative; overflow: hidden;
    background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 55%, #1d4ed8 100%);
    color: #fff;
    padding: 28px 28px;
    display: flex; flex-direction: column;
    height: 100vh;
}
.auth-brand::before {
    content: ""; position: absolute; inset: 0;
    background-image: radial-gradient(circle at 20% 10%, rgba(255,255,255,.18), transparent 35%),
                      radial-gradient(circle at 80% 90%, rgba(255,255,255,.12), transparent 40%);
    pointer-events: none;
}
.brand-inner { position: relative; max-width: 480px; margin: 0 auto; width: 100%; flex: 1; display: flex; flex-direction: column; }

.brand-logo {
    display: inline-flex; align-items: center; gap: 10px;
    text-decoration: none; color: #fff;
}
.brand-logo img { height: 36px; width: auto; filter: brightness(0) invert(1); }

.brand-hero { margin: auto 0; padding: 16px 0; }
.brand-hero h1 {
    margin: 0 0 12px; font-size: 30px; line-height: 1.15;
    font-weight: 800; letter-spacing: -.01em;
}
.brand-hero p {
    margin: 0 0 22px; font-size: 15px; line-height: 1.55;
    color: rgba(255,255,255,.85);
}
.brand-features { list-style: none; padding: 0; margin: 0; }
.brand-features li {
    display: flex; align-items: flex-start; gap: 10px;
    padding: 7px 0; font-size: 14px; color: rgba(255,255,255,.92);
}
.brand-features .check {
    width: 26px; height: 26px; flex-shrink: 0;
    border-radius: 8px; background: rgba(255,255,255,.18);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 12px;
}
.brand-features strong { color: #fff; font-weight: 700; }

.brand-foot {
    margin-top: 20px; padding-top: 18px;
    border-top: 1px solid rgba(255,255,255,.18);
    font-size: 12px; color: rgba(255,255,255,.7);
    display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.brand-foot a { color: rgba(255,255,255,.9); text-decoration: none; }
.brand-foot a:hover { text-decoration: underline; }

/* ---------- Form panel ---------- */
.auth-form-panel {
    display: flex; align-items: center; justify-content: center;
    padding: 24px 20px;
    background: var(--auth-bg);
    height: 100vh; overflow: hidden;
}
.auth-form-inner {
    width: 100%; max-width: 420px;
    max-height: calc(100vh - 48px);
    overflow-y: auto;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    box-shadow: var(--auth-shadow);
    padding: 28px 28px 24px;
}
.auth-form-inner::-webkit-scrollbar { width: 6px; }
.auth-form-inner::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 999px; }

.auth-form-mobile-logo {
    display: none; text-align: center; margin-bottom: 18px;
}
.auth-form-mobile-logo img { height: 42px; }

.auth-form-header { margin-bottom: 22px; text-align: center; }
.auth-form-header h2 {
    margin: 0 0 4px; font-size: 22px; font-weight: 800; letter-spacing: -.01em;
}
.auth-form-header p { margin: 0; color: var(--auth-muted); font-size: 13px; }

.auth-alert {
    border-radius: 10px; padding: 10px 12px; font-size: 13px;
    margin-bottom: 12px; display: flex; align-items: flex-start; gap: 10px;
}
.auth-alert i { margin-top: 2px; }
.auth-alert.is-success { background: var(--auth-success-soft); color: #166534; border: 1px solid #bbf7d0; }
.auth-alert.is-error   { background: var(--auth-danger-soft);  color: #991b1b; border: 1px solid #fecaca; }
.auth-alert .close {
    margin-left: auto; opacity: .6; background: transparent;
    border: 0; color: inherit; font-size: 18px; line-height: 1; cursor: pointer;
}
.auth-alert .close:hover { opacity: 1; }

/* ---------- Fields ---------- */
.field { margin-bottom: 14px; }
.field-label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--auth-muted); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: .04em;
}
.field-control {
    position: relative; display: flex; align-items: stretch;
    border: 1px solid var(--auth-border); border-radius: 10px;
    background: #fff; transition: border-color .15s, box-shadow .15s;
}
.field-control:focus-within {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field-icon {
    flex-shrink: 0; width: 42px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--auth-muted); font-size: 14px;
    border-right: 1px solid var(--auth-border);
}
.field-control input.form-control {
    border: 0 !important; box-shadow: none !important; outline: none !important;
    background: transparent !important; color: var(--auth-text);
    height: 42px !important; padding: 0 14px 0 12px !important;
    font-size: 14px !important; flex: 1; width: 100%;
    border-radius: 0 10px 10px 0 !important;
}
.field-control .toggle-pwd {
    display: inline-flex; align-items: center; justify-content: center;
    width: 42px; color: var(--auth-muted); border-left: 1px solid var(--auth-border);
    cursor: pointer; background: transparent; border-top: 0; border-right: 0; border-bottom: 0;
    font-size: 14px;
}
.field-control .toggle-pwd:hover { color: var(--auth-text); }
.field-control input.form-control::placeholder { color: #94a3b8; }

/* ---------- Helper row (forgot password) ---------- */
.helper-row {
    display: flex; align-items: center; justify-content: flex-end;
    margin: -6px 2px 14px;
}
.helper-row a {
    font-size: 12px; color: var(--auth-primary);
    font-weight: 600; text-decoration: none;
}
.helper-row a:hover { text-decoration: underline; }

/* ---------- Primary button ---------- */
.btn-primary-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 44px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff !important; border: 0; border-radius: 10px;
    font-size: 14px; font-weight: 700; letter-spacing: .01em;
    cursor: pointer; transition: transform .12s, box-shadow .15s, opacity .15s;
    box-shadow: 0 6px 18px rgba(37,99,235,.28);
}
.btn-primary-cta:hover { box-shadow: 0 10px 22px rgba(37,99,235,.34); }
.btn-primary-cta:active { transform: translateY(1px); }

/* ---------- Foot links + Google Play ---------- */
.auth-form-foot {
    text-align: center; margin-top: 16px;
    font-size: 13px; color: var(--auth-muted);
}
.auth-form-foot a {
    color: var(--auth-primary); font-weight: 600;
    text-decoration: none;
}
.auth-form-foot a:hover { text-decoration: underline; }

.legal-links {
    margin-top: 12px; text-align: center;
    font-size: 12px; color: var(--auth-muted);
}
.legal-links a { color: var(--auth-muted); text-decoration: none; }
.legal-links a:hover { color: var(--auth-text); text-decoration: underline; }
.legal-links .dot { margin: 0 8px; color: #cbd5e1; }

.divider {
    display: flex; align-items: center; gap: 10px;
    margin: 18px 0 14px;
    color: var(--auth-muted); font-size: 11px;
    text-transform: uppercase; letter-spacing: .08em;
}
.divider::before, .divider::after {
    content: ""; flex: 1; height: 1px; background: var(--auth-border);
}

.play-store {
    display: flex; justify-content: center;
}
.play-store img {
    height: 44px; transition: transform .15s;
}
.play-store a:hover img { transform: translateY(-2px); }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    .auth-shell { grid-template-columns: 1fr !important; }
    .auth-brand { display: none !important; }
    .auth-form-panel { padding: 16px; height: 100vh; }
    .auth-form-inner {
        padding: 22px 22px 20px;
        max-height: calc(100vh - 32px);
    }
    .auth-form-mobile-logo { display: block; }
}
@media (max-width: 575px) {
    .auth-form-panel { padding: 10px; }
    .auth-form-inner {
        padding: 18px 18px 16px;
        border-radius: 12px;
        max-height: calc(100vh - 20px);
    }
    .auth-form-header h2 { font-size: 19px; }
}
@media (max-height: 720px) {
    .auth-form-header { margin-bottom: 14px; }
    .field { margin-bottom: 10px; }
    .brand-hero h1 { font-size: 24px; }
    .brand-features li { padding: 5px 0; font-size: 13px; }
}
