/* Snow Peak brand palette — ManualDeMarca-SnowPeak.pdf §4.1 (same tokens as WEBAPP INSPECTION) */
:root {
  --navy-900: #172439;
  --navy-800: #33346a;
  --navy-700: #51469c;
  --navy-600: #7c6fc4;
  --slate-100: #f9f9fa;
  --tint-100: #e8f0ee;
  --slate-200: #dce4ed;
  --slate-300: #b8c9db;
  --slate-500: #5c7290;
  --white: #ffffff;
  --lime-500: #c1d552;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-bg: #f0fdf4;
  --green-border: #bbf7d0;
  --red-500: #ef4444;
  --red-600: #dc2626;
  --red-bg: #fef2f2;
  --red-border: #fecaca;
  --amber-500: #f59e0b;
  --amber-bg: #fffbeb;
  --amber-border: #fde68a;
  --radius: 12px;
  --shadow-sm: 0 1px 3px rgba(23,36,57,0.08);
  --shadow-md: 0 4px 12px rgba(23,36,57,0.12);
  --shadow-lg: 0 8px 30px rgba(23,36,57,0.16);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Montserrat', system-ui, sans-serif;
  background: var(--slate-100);
  color: var(--navy-900);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

.screen { display: none; min-height: 100dvh; flex-direction: column; }
.screen.active { display: flex; }

/* ── HEADER ── */
.app-header {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-800));
  color: var(--white);
  padding: 16px 20px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: var(--shadow-md);
}
.app-header .logo { color: var(--white); display: flex; align-items: center; }
.app-header .logo .brand-mark { width: 26px; height: auto; display: block; }
.app-header .brand { flex: 1; }
.app-header .brand h1 { font-size: 15px; font-weight: 800; letter-spacing: 0.02em; }
.app-header .brand p { font-size: 11px; opacity: 0.7; font-weight: 500; margin-top: 1px; }
.header-btn {
  background: rgba(255,255,255,0.12); border: none; color: white;
  width: 38px; height: 38px; border-radius: 10px; font-size: 18px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.header-btn:hover { background: rgba(255,255,255,0.2); }

/* ── LOGIN / AUTH CARD ── */
.login-screen {
  background: linear-gradient(160deg, var(--navy-900) 0%, var(--navy-700) 100%);
  justify-content: center; align-items: center; padding: 24px;
}
.login-card {
  background: var(--white); border-radius: 20px; padding: 40px 28px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: var(--shadow-lg);
}
.login-card .logo-big { color: var(--navy-700); margin: 0 auto 12px; display: flex; justify-content: center; }
.login-card .logo-big .brand-mark { width: 56px; height: auto; display: block; }
.login-card h2 { font-size: 20px; font-weight: 800; color: var(--navy-900); margin-bottom: 4px; }
.login-card .subtitle { font-size: 13px; color: var(--slate-500); font-weight: 500; margin-bottom: 28px; }
.login-error { color: var(--red-500); font-size: 13px; font-weight: 600; margin-top: -8px; margin-bottom: 16px; display: none; }
.login-error.show { display: block; }
.login-note { font-size: 12px; color: var(--slate-500); font-weight: 500; margin-top: 16px; }

.login-info { color: var(--navy-700); background: var(--tint-100); border-radius: 8px; padding: 10px 12px; font-size: 12px; font-weight: 600; margin-top: -6px; margin-bottom: 16px; display: none; text-align: left; }
.login-info.show { display: block; }
.forgot-password-link { text-align: right; margin: -10px 0 16px; }
.forgot-password-link a { font-size: 12px; color: var(--navy-700); font-weight: 600; text-decoration: none; }
.forgot-password-link a:hover { text-decoration: underline; }

.btn-login {
  width: 100%; padding: 14px; background: linear-gradient(135deg, var(--navy-800), var(--navy-700));
  color: white; border: none; border-radius: 12px;
  font-family: 'Montserrat', sans-serif; font-size: 15px; font-weight: 700;
  cursor: pointer; transition: transform 0.15s;
}
.btn-login:active { transform: scale(0.97); }
.btn-login:disabled { opacity: 0.5; cursor: not-allowed; }

/* ── MAIN CONTENT ──
   Mobile-first: .content takes up the full width. From tablet up it's
   centered in a comfortable reading column; on desktop it widens quite
   a bit more — pages that want to use that space (dispatcher) use
   .desktop-grid inside to switch to a real two-column layout. */
.content { flex: 1; width: 100%; padding: 20px; padding-bottom: 60px; }
@media (min-width: 700px) { .content { max-width: 640px; margin: 0 auto; } }
@media (min-width: 1024px) { .content { max-width: 900px; padding: 32px; } }
@media (min-width: 1280px) { .content { max-width: 1180px; } }

/* Two-column layout for desktop (dispatcher: controls + map;
   portal: host families + students). On mobile/tablet it's a single
   stacked column (default behavior, no grid). Each page defines its
   own grid-template-columns if it needs proportions other than the
   1:1 default. */
.right-col { margin-top: 20px; }
@media (min-width: 1024px) {
  .desktop-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: start; }
  .right-col { margin-top: 0; }
}

.section-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--slate-500); margin-bottom: 10px;
}
.card {
  background: var(--white); border-radius: var(--radius); padding: 16px;
  margin-bottom: 16px; box-shadow: var(--shadow-sm);
}

.field-group { margin-bottom: 14px; text-align: left; }
.field-group label {
  display: block; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--slate-500); margin-bottom: 6px;
}
.field-input {
  width: 100%; padding: 12px 14px; border: 2px solid var(--slate-200); border-radius: 10px;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 600;
  color: var(--navy-900); background: var(--white);
}
.field-input:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 3px rgba(81,70,156,0.12); }
.field-input.error { border-color: var(--red-500); }

.password-field-wrap { position: relative; }
.password-field-wrap .field-input { padding-right: 44px; }
.password-toggle-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border: none; background: transparent; cursor: pointer;
  font-size: 16px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px; color: var(--slate-500); padding: 0;
}
.password-toggle-btn:hover { background: var(--slate-100); }

.remember-me-row {
  display: flex; align-items: center; gap: 8px; margin: -6px 0 16px;
  font-size: 13px; font-weight: 600; color: var(--navy-900); cursor: pointer;
}
.remember-me-row input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--navy-700); cursor: pointer; }

.btn-primary {
  width: 100%; padding: 14px; border: none; border-radius: var(--radius);
  background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); color: white;
  font-family: 'Montserrat', sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: transform 0.15s, opacity 0.2s;
}
.btn-primary:active { transform: scale(0.97); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-secondary {
  width: 100%; padding: 12px; border: 1.5px solid var(--slate-200); border-radius: var(--radius);
  background: var(--white); color: var(--navy-900);
  font-family: 'Montserrat', sans-serif; font-size: 13px; font-weight: 700; cursor: pointer;
}
.btn-danger {
  padding: 8px 12px; border: 1.5px solid var(--red-border); border-radius: 8px;
  background: var(--red-bg); color: var(--red-600);
  font-family: 'Montserrat', sans-serif; font-size: 12px; font-weight: 700; cursor: pointer;
}

.empty-state { text-align: center; padding: 24px 12px; color: var(--slate-500); font-size: 13px; font-weight: 500; }

.banner {
  padding: 12px 14px; border-radius: 10px; font-size: 12px; font-weight: 600; margin-bottom: 16px;
}
.banner.warn { background: var(--amber-bg); border: 1px solid var(--amber-border); color: #92660a; }
.banner.error { background: var(--red-bg); border: 1px solid var(--red-border); color: var(--red-600); }
.banner.info { background: var(--tint-100); color: var(--navy-700); }
.banner.success { background: var(--green-bg); border: 1px solid var(--green-border); color: var(--green-600); }

.spinner {
  display: inline-block; width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.hidden { display: none !important; }
