/* nnnHome — in-car dashboard.
   Tuned for the Tesla Model Y landscape touchscreen: dark, high-contrast,
   generous hit targets (nothing tappable smaller than ~64px), and a layout
   that fills a wide screen without demanding scroll for the primary action. */

:root {
  --bg: #0a0d12;
  --panel: #151a22;
  --panel-2: #1d2530;
  --line: #2a333f;
  --text: #f2f5f8;
  --muted: #8b98a8;
  --accent: #3b9dff;
  --accent-press: #1f7aec;
  --ok: #35d07f;
  --ok-glow: rgba(53, 208, 127, 0.35);
  --danger: #ff5a5f;
  --radius: 20px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

body {
  padding: clamp(16px, 2.5vw, 32px);
}

/* ── Top bar: clock, date, status ─────────────────────────────────────────── */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: clamp(16px, 3vh, 32px);
}

.clock {
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.date {
  font-size: clamp(15px, 1.8vw, 22px);
  color: var(--muted);
  margin-top: 6px;
}

.status {
  font-size: clamp(13px, 1.4vw, 17px);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 10px;
}

.logout {
  background: var(--panel);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 18px;
  font-size: 15px;
  cursor: pointer;
}

/* ── Grid layout ──────────────────────────────────────────────────────────── */

.grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: clamp(16px, 2vw, 28px);
  align-items: stretch;
}

@media (max-width: 900px) {
  .grid { grid-template-columns: 1fr; }
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(18px, 2vw, 28px);
  box-shadow: var(--shadow);
}

.panel h2 {
  margin: 0 0 16px;
  font-size: clamp(15px, 1.6vw, 19px);
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ── The garage button: the whole point ───────────────────────────────────── */

.garage {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.gate-btn {
  width: 100%;
  min-height: clamp(200px, 32vh, 320px);
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--accent), var(--accent-press));
  color: #fff;
  font-size: clamp(30px, 4.5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  transition: transform 0.08s ease, box-shadow 0.25s ease, background 0.25s ease;
  box-shadow: 0 12px 34px rgba(31, 122, 236, 0.35);
}

.gate-btn .icon { font-size: 1.6em; line-height: 1; }
.gate-btn:active { transform: scale(0.98); }

.gate-btn.busy {
  background: linear-gradient(180deg, #4a5766, #37424f);
  box-shadow: none;
}

.gate-btn.success {
  background: linear-gradient(180deg, var(--ok), #23a866);
  box-shadow: 0 0 0 6px var(--ok-glow), 0 12px 34px var(--ok-glow);
}

.gate-btn.error {
  background: linear-gradient(180deg, var(--danger), #d23b40);
}

.gate-hint {
  margin-top: 16px;
  color: var(--muted);
  font-size: clamp(13px, 1.4vw, 16px);
  min-height: 1.4em;
}

/* ── Shortcuts grid ───────────────────────────────────────────────────────── */

.shortcuts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 14px;
}

.shortcut {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 10px;
  min-height: 96px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: transform 0.08s ease, border-color 0.2s ease;
}

.shortcut:active { transform: scale(0.96); }
.shortcut .sc-icon { font-size: 30px; line-height: 1; }
.shortcut .sc-label { font-size: 14px; color: var(--muted); text-align: center; }

.shortcut.add {
  border-style: dashed;
  color: var(--muted);
}

.shortcut .sc-del {
  position: absolute;
  top: 6px;
  right: 8px;
  color: var(--danger);
  font-size: 18px;
}
.shortcut { position: relative; }

/* ── Reminders ────────────────────────────────────────────────────────────── */

.reminder-add {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.reminder-add input {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 14px 16px;
  font-size: 16px;
}

.reminder-add input:focus { outline: none; border-color: var(--accent); }

.btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.btn:active { transform: scale(0.97); }
.btn.ghost { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); }

.reminders-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }

.reminder {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 16px;
}

.reminder .check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--line);
  flex: 0 0 auto;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: transparent;
}
.reminder.done .check { background: var(--ok); border-color: var(--ok); color: #06210f; }
.reminder.done .r-text { text-decoration: line-through; color: var(--muted); }

.reminder .r-body { flex: 1; }
.reminder .r-text { font-size: 16px; }
.reminder .r-when { font-size: 13px; color: var(--muted); margin-top: 3px; }
.reminder .r-del { color: var(--muted); font-size: 22px; cursor: pointer; padding: 0 6px; }

.empty { color: var(--muted); font-size: 15px; padding: 8px 2px; }

/* ── Login page ───────────────────────────────────────────────────────────── */

.login-wrap {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(28px, 4vw, 48px);
  width: min(440px, 92vw);
  box-shadow: var(--shadow);
  text-align: center;
}

.login-card h1 { margin: 0 0 6px; font-size: 30px; }
.login-card p { color: var(--muted); margin: 0 0 28px; }

.login-card input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  padding: 18px 18px;
  font-size: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.login-card input:focus { outline: none; border-color: var(--accent); }

.login-card button {
  width: 100%;
  background: linear-gradient(180deg, var(--accent), var(--accent-press));
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 18px;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.login-error { color: var(--danger); min-height: 1.4em; margin-top: 14px; font-size: 15px; }

/* ── Simple modal for adding a shortcut ───────────────────────────────────── */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 50;
}
.modal-backdrop.open { display: flex; }

.modal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  width: min(440px, 92vw);
  box-shadow: var(--shadow);
}
.modal h3 { margin: 0 0 18px; }
.modal label { display: block; font-size: 14px; color: var(--muted); margin: 14px 0 6px; }
.modal input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--text);
  padding: 14px;
  font-size: 16px;
}
.modal input:focus { outline: none; border-color: var(--accent); }
.modal-actions { display: flex; gap: 10px; margin-top: 24px; }
.modal-actions .btn { flex: 1; }
