/* ============================================================
   NRestro — Restaurant registration 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: 24px 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-logo span { font-weight: 700; font-size: 18px; letter-spacing: .02em; }

.brand-hero { margin: auto 0; padding: 16px 0; }
.brand-hero h1 {
    margin: 0 0 10px; font-size: 26px; line-height: 1.15;
    font-weight: 800; letter-spacing: -.01em;
}
.brand-hero p {
    margin: 0 0 18px; font-size: 14px; line-height: 1.5;
    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: 6px 0; font-size: 13px; 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: 16px 16px;
    background: var(--auth-bg);
    height: 100vh; overflow: hidden;
}
.auth-form-inner {
    width: 100%; max-width: 520px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--auth-surface);
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    box-shadow: var(--auth-shadow);
    padding: 20px 22px 18px;
}
/* Slim scrollbar in case the form must scroll on very short viewports */
.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: 16px;
}
.auth-form-mobile-logo img { height: 40px; }
@media (max-width: 991px) {
    .auth-form-mobile-logo { display: block; }
}

.auth-form-header { margin-bottom: 14px; }
.auth-form-header h2 {
    margin: 0 0 2px; font-size: 20px; font-weight: 800; letter-spacing: -.01em;
}
.auth-form-header p { margin: 0; color: var(--auth-muted); font-size: 12px; }

.auth-alert {
    border-radius: 10px; padding: 10px 12px; font-size: 13px;
    margin-bottom: 12px;
}
.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:empty { display: none; }

/* ---------- Fields ---------- */
.field { margin-bottom: 10px; min-width: 0; }
.field-label {
    display: block; font-size: 11px; font-weight: 600;
    color: var(--auth-muted); margin-bottom: 4px;
    text-transform: uppercase; letter-spacing: .04em;
}
.field-control {
    position: relative; display: flex; align-items: stretch;
    border: 1px solid var(--auth-border); border-radius: 9px;
    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: 36px;
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--auth-muted); font-size: 13px;
    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: 38px !important; padding: 0 12px 0 10px !important;
    font-size: 13px !important; flex: 1; width: 100%; min-width: 0;
    border-radius: 0 9px 9px 0 !important;
}
.field-control input.form-control::placeholder { color: #94a3b8; }
.field-control input.form-control:disabled { background: #f8fafc !important; }

.field-help { font-size: 11px; color: var(--auth-muted); margin: 4px 2px 0; }
.field-error {
    display: block; color: var(--auth-danger); font-size: 11px;
    margin: 4px 2px 0; min-height: 0;
}
.field-error:empty { display: none; }

/* Two-column row for paired fields (e.g. password + confirm) */
.field-row {
    display: grid; gap: 10px;
    grid-template-columns: 1fr;
    margin-bottom: 10px;
}
@media (min-width: 576px) {
    .field-row { grid-template-columns: 1fr 1fr; }
    .field-row > .field { margin-bottom: 0; }
}

/* Password strength checklist (kept structure-compatible with existing JS show/hide) */
.password-rules {
    margin: 6px 0 0; padding: 8px 10px;
    background: #fff7f7; border: 1px solid #fecaca; border-radius: 8px;
}
.password-rules p { color: var(--auth-danger); font-size: 11px; margin: 0 0 4px; font-weight: 600; }
.password-rules ul { list-style: none; padding: 0; margin: 0; font-size: 11px; }
.password-rules li {
    color: var(--auth-danger); padding: 1px 0;
    display: flex; align-items: center; gap: 6px;
}
.password-rules li::before {
    content: "\f00d"; font-family: FontAwesome; font-size: 10px;
    width: 14px; text-align: center;
}
.passwordError.hidden { display: none !important; }
.passwordError.show { display: block; }

/* ---------- Terms & checkbox ---------- */
.terms-row {
    display: flex; align-items: center; gap: 8px;
    background: #f8fafc; border: 1px solid var(--auth-border);
    border-radius: 9px; padding: 8px 10px;
    margin: 10px 0 6px;
}
.terms-row input[type=checkbox] {
    margin: 0; width: 16px; height: 16px;
    accent-color: var(--auth-primary); cursor: pointer; flex-shrink: 0;
}
.terms-row label { margin: 0; font-size: 12px; color: var(--auth-text); cursor: pointer; line-height: 1.35; }
.terms-link {
    color: var(--auth-primary); font-weight: 600; cursor: pointer; margin-left: 4px;
}
.terms-link:hover { color: var(--auth-primary-dark); text-decoration: underline; }

/* iCheck override: hide the custom widget on inputs we don't want it on (the checkbox uses the native one styled above) */
.terms-row .icheckbox_square-blue { display: none !important; }

/* reCAPTCHA spacing */
.captcha-row { margin: 6px 0 10px; display: flex; justify-content: flex-start; transform-origin: top left; }
.captcha-row .g-recaptcha > div { max-width: 100%; }
/* Optional: shrink reCAPTCHA slightly on short viewports so the button stays visible */
@media (max-height: 760px) {
    .captcha-row { transform: scale(.9); margin-bottom: 4px; }
}

/* ---------- Primary button ---------- */
.btn-primary-cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    width: 100%; height: 40px;
    background: linear-gradient(135deg, var(--auth-primary), var(--auth-primary-dark));
    color: #fff !important; border: 0; border-radius: 9px;
    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); }

/* ---------- Footer links under form ---------- */
.auth-form-foot {
    text-align: center; margin-top: 10px;
    font-size: 12px; 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; }
.auth-form-foot .dot { margin: 0 8px; color: #cbd5e1; }

/* ---------- Terms modal polish ---------- */
#termsModal .modal-content {
    border: 0; border-radius: 14px; overflow: hidden;
    box-shadow: 0 20px 50px rgba(15,23,42,.25);
}
#termsModal .modal-header {
    padding: 14px 18px; border-bottom: 1px solid var(--auth-border);
    background: #fafbfc;
}
#termsModal .modal-title { font-size: 16px; font-weight: 700; color: var(--auth-text); }
#termsModal .modal-body {
    padding: 16px 18px; font-size: 13px; color: var(--auth-text);
    max-height: 60vh; overflow-y: auto;
}
#termsModal .modal-body ol { padding-left: 20px; }
#termsModal .modal-body ol > li { margin-bottom: 10px; }
#termsModal .modal-footer {
    padding: 12px 18px; border-top: 1px solid var(--auth-border);
    background: #fafbfc;
}
#termsModal .mr-btn-primary {
    background: var(--auth-primary) !important; color: #fff !important;
    border: 1px solid var(--auth-primary) !important;
    border-radius: 8px !important; padding: 8px 16px !important;
    font-weight: 600 !important;
}
#termsModal .mr-btn-primary i { margin-right: 6px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
    /* Hide the brand panel entirely on phones/tablets so the form gets the full viewport */
    .auth-shell { grid-template-columns: 1fr !important; }
    .auth-brand { display: none !important; }
    .auth-form-panel { padding: 12px; height: 100vh; }
    .auth-form-inner {
        padding: 16px 18px 14px;
        max-height: calc(100vh - 24px);
        max-width: 540px;
    }
}
@media (max-width: 575px) {
    .auth-form-panel { padding: 8px; }
    .auth-form-inner {
        padding: 14px 14px 12px;
        max-height: calc(100vh - 16px);
        border-radius: 12px;
    }
    .auth-form-header h2 { font-size: 18px; }
}
/* Short viewports — pack tighter so we don't trigger the internal scroll */
@media (max-height: 720px) {
    .auth-form-header { margin-bottom: 10px; }
    .field { margin-bottom: 8px; }
    .field-row { margin-bottom: 8px; }
    .terms-row { padding: 6px 10px; margin: 8px 0 4px; }
    .btn-primary-cta { height: 38px; }
}
