/* ================================================================
   WeatherGrid — Observer App  ·  Design System
   Friendly Professional: warm orange accent, calm slate-blue text,
   rounded cards, generous whitespace, airy spacing
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ── Design Tokens ─────────────────────────── */
:root {
  /* Accent */
  --accent: #FF7A45;
  --accent-hover: #F05F26;
  --accent-soft: #FFF1EA;
  --accent-ring: rgba(255,122,69,.28);

  /* Ink (text) */
  --ink: #33475B;
  --ink-strong: #213343;
  --ink-muted: #5C7C96;
  --ink-faint: #8FA9BD;

  /* Surfaces */
  --surface: #FFFFFF;
  --canvas: #F4F8FB;
  --line: #E1E9F0;
  --line-strong: #CFDDE8;

  /* Semantic */
  --success: #00A578;
  --success-soft: #E6F7F1;
  --error: #E53E3E;
  --error-soft: #FFF0F0;

  /* Radii */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 26px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(33,51,67,.04), 0 8px 24px -12px rgba(33,51,67,.14);
  --shadow-cta: 0 10px 24px -8px rgba(255,122,69,.55);

  /* Motion */
  --duration-fast: 150ms;
  --duration-normal: 250ms;
  --duration-slow: 400ms;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.45, 0, 0.55, 1);
}

/* ── Reset ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 500px at 50% -10%, #EDF4F9 0%, rgba(237,244,249,0) 70%),
    #E7EEF4;
  min-height: 100vh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 44px 16px 64px;
  width: 1440px;
  margin: 0 auto;
}

/* ── Device Frame ──────────────────────────── */
.device {
  width: 414px;
  border-radius: 58px;
  padding: 12px;
  background: linear-gradient(160deg, #2B3B4A, #101a23 60%);
  box-shadow:
    0 0 0 1.5px #3d4f5e,
    0 40px 70px -24px rgba(16,26,35,.55),
    0 8px 20px rgba(16,26,35,.18);
  position: relative;
}

.screen {
  width: 390px;
  height: 844px;
  border-radius: 47px;
  overflow: hidden;
  background: var(--canvas);
  position: relative;
  display: flex;
  flex-direction: column;
}

.side-btn { position: absolute; background: #26343f; border-radius: 3px; width: 3px; }
.side-btn.a { left: -3px; top: 132px; height: 30px; }
.side-btn.b { left: -3px; top: 184px; height: 56px; }
.side-btn.c { left: -3px; top: 254px; height: 56px; }
.side-btn.d { right: -3px; top: 200px; height: 86px; }

/* ── Status Bar ────────────────────────────── */
.island {
  position: absolute;
  top: 9px;
  left: 50%;
  transform: translateX(-50%);
  width: 106px;
  height: 31px;
  border-radius: 20px;
  background: #0c1319;
  z-index: 10;
}

.statusbar {
  height: 54px;
  padding: 0 30px 0 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  color: var(--ink-strong);
  background: var(--surface);
  position: relative;
  z-index: 6;
  flex: none;
}

.sb-right { display: flex; align-items: center; gap: 6px; }

/* ── App Mount ─────────────────────────────── */
#app {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  -webkit-overflow-scrolling: touch;
}

#app::-webkit-scrollbar { width: 0; }

/* ── App Bar (Shell Chrome) ────────────────── */
.appbar {
  background: var(--surface);
  padding: 4px 20px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.logo {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(150deg, #FF9163, var(--accent));
  display: grid;
  place-items: center;
  flex: none;
  box-shadow: 0 6px 14px -6px rgba(255,122,69,.7);
}

.brand h1 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.2px;
}

.brand p {
  margin: 1px 0 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-faint);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.appbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.shell-profile {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #B8D4E8, #8FB8D4);
  color: #fff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
  padding: 0;
}

.shell-profile:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 12px -4px rgba(143,184,212,.5);
}

.shell-profile:active {
  transform: scale(0.94);
}

.shell-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink-muted);
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.shell-logout:hover {
  background: var(--error-soft);
  border-color: #fcc;
  color: var(--error);
}

.shell-logout:active {
  transform: scale(0.94);
}

/* ── Profile Popup ────────────────────────── */
.profile-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: 12px;
  width: 220px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.18);
  padding: 20px;
  z-index: 10;
  animation: fadeIn var(--duration-fast) var(--ease-out);
}

.profile-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.profile-popup-avatar {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(150deg, #FF9163, var(--accent));
  display: grid;
  place-items: center;
  font-size: 17px;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
}

.profile-popup-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--canvas);
  color: var(--ink-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
  transition: all var(--duration-fast) var(--ease-out);
}

.profile-popup-close:hover {
  background: var(--error-soft);
  border-color: #fcc;
  color: var(--error);
}

.profile-popup-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.2px;
}

.profile-popup-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 3px;
}

/* ── Greeting ──────────────────────────────── */
.greet { margin: 0 2px 18px; }
.greet h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.24;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.5px;
}
.greet p {
  margin: 6px 0 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-muted);
  font-weight: 500;
}

/* ── Confirmation Banner ───────────────────── */
.confirm-banner {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  background: var(--success-soft);
  border: 1px solid #C7EBDF;
  border-radius: var(--r-md);
  padding: 12px 12px 12px 13px;
  margin-bottom: 16px;
}

.confirm-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--success);
  display: grid;
  place-items: center;
  flex: none;
  margin-top: 1px;
}

.confirm-text b {
  display: block;
  font-size: 13px;
  color: #0A6E56;
  font-weight: 800;
}

.confirm-text span {
  display: block;
  font-size: 11.5px;
  color: #3F8C77;
  font-weight: 600;
  margin-top: 2px;
}

/* ── Body ──────────────────────────────────── */
.wr-body {
  padding: 20px 20px 24px;
  flex: 1;
}

/* ── Card ──────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-card);
  padding: 20px 18px 6px;
  margin-bottom: 18px;
}

.card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.card-head h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.2px;
}

.pill {
  margin-left: auto;
  font-size: 11px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 6px 10px;
  border-radius: 999px;
  letter-spacing: 0.2px;
  transition: all var(--duration-normal) var(--ease-out);
}

.pill-complete {
  color: #068062;
  background: var(--success-soft);
}

/* ── Form Fields ───────────────────────────── */
.field { margin-bottom: 20px; }

.label {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px 2px;
  letter-spacing: -0.1px;
}

.req { color: var(--accent); font-weight: 800; }

.input {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #F8FAFC;
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 0 14px;
  height: 54px;
  transition: all var(--duration-fast) var(--ease-out);
}

.input .ico {
  flex: none;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  transition: color var(--duration-fast);
}

.input .txt {
  border: 0;
  background: transparent;
  outline: none;
  flex: 1;
  font-family: inherit;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.1px;
  width: 100%;
}

.input .txt::placeholder { color: #A8BECF; font-weight: 500; }

.input.filled { background: var(--surface); border-color: var(--line-strong); }
.input.filled .ico { color: var(--ink-muted); }

.input.focus {
  background: var(--surface);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}
.input.focus .ico { color: var(--accent); }

.input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(229,62,62,.12);
}

.field-error {
  display: block;
  min-height: 18px;
  margin: 5px 0 0 2px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--error);
  transition: opacity var(--duration-fast);
}

/* ── Number Input Duo ──────────────────────── */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.num-cell { display: flex; flex-direction: column; }

.num {
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-md);
  background: var(--surface);
  padding: 12px 12px 12px;
  transition: all var(--duration-fast) var(--ease-out);
}

.num.focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-ring);
}

.num.filled { border-color: var(--line-strong); }

.num.error {
  border-color: var(--error);
  box-shadow: 0 0 0 4px rgba(229,62,62,.12);
}

.num .cap {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.num .val {
  display: flex;
  align-items: baseline;
  gap: 4px;
  margin-top: 6px;
}

.num .val input {
  border: 0;
  outline: none;
  background: transparent;
  width: 100%;
  font-family: inherit;
  font-size: 27px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -1px;
  padding: 0;
}

.num .val input::placeholder { color: #C5D3DE; }

.num .unit {
  font-size: 13px;
  font-weight: 800;
  color: var(--accent);
  flex: none;
}

.num-error {
  margin: 4px 0 0 2px;
}

/* ── Meta ──────────────────────────────────── */
.meta {
  display: flex;
  align-items: center;
  gap: 9px;
  border-top: 1px dashed var(--line);
  margin: 2px -18px 0;
  padding: 14px 18px;
  color: var(--ink-faint);
}

.meta p {
  margin: 0;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-faint);
  line-height: 1.45;
}

/* ── CTA Wrap (Sticky Bottom) ──────────────── */
.cta-wrap {
  position: sticky;
  bottom: 0;
  z-index: 8;
  padding: 14px 20px 34px;
  background: linear-gradient(180deg, rgba(244,248,251,0) 0%, rgba(244,248,251,.92) 26%, #F4F8FB 55%);
  flex: none;
}

.progress { display: flex; align-items: center; gap: 8px; margin: 0 2px 10px; }
.bars { display: flex; gap: 4px; }
.bars i { width: 22px; height: 4px; border-radius: 2px; background: var(--accent); transition: background var(--duration-normal); }
.bars i.bar-empty { background: var(--line-strong); }
.progress span { font-size: 11.5px; font-weight: 700; color: var(--ink-muted); }
.progress-ok { margin-left: auto; font-size: 11.5px; font-weight: 800; color: var(--success); }

.cta {
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 18px;
  background: linear-gradient(180deg, #FF8A57, var(--accent));
  color: #fff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.2px;
  box-shadow: var(--shadow-cta);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  cursor: pointer;
  transition: all var(--duration-fast) var(--ease-out);
}

.cta:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px -8px rgba(255,122,69,.6);
}

.cta:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  box-shadow: 0 6px 16px -6px rgba(255,122,69,.5);
}

.cta-disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

.cta .icon { color: #fff; }

/* ── Login Screen ──────────────────────────── */
.login-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 40px 24px 34px;
  background: var(--canvas);
}

.login-header {
  text-align: center;
  margin-bottom: 36px;
}

.login-logo {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  background: linear-gradient(150deg, #FF9163, var(--accent));
  display: grid;
  place-items: center;
  margin: 0 auto 18px;
  box-shadow: 0 10px 24px -8px rgba(255,122,69,.55);
}

.login-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.6px;
}

.login-subtitle {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-muted);
}

.login-cards {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── Persona Card ──────────────────────────── */
.persona-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px 16px;
  cursor: pointer;
  transition: all var(--duration-normal) var(--ease-out);
  box-shadow: var(--shadow-card);
}

.persona-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(33,51,67,.06), 0 12px 28px -12px rgba(33,51,67,.18);
}

.persona-card.selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  box-shadow: 0 0 0 4px var(--accent-ring), var(--shadow-card);
}

.persona-avatar {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(150deg, #B8D4E8, #8FB8D4);
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 800;
  color: #fff;
  flex: none;
  letter-spacing: 0.5px;
}

.persona-card.selected .persona-avatar {
  background: linear-gradient(150deg, #FF9163, var(--accent));
}

.persona-info { flex: 1; }

.persona-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink-strong);
  letter-spacing: -0.2px;
}

.persona-role {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-muted);
  margin-top: 2px;
}

.persona-check {
  color: var(--line-strong);
  transition: color var(--duration-normal);
}

.persona-check .check-path {
  opacity: 0;
  transition: opacity var(--duration-normal);
}

.persona-card.selected .persona-check {
  color: var(--accent);
}

.persona-card.selected .persona-check .check-path {
  opacity: 1;
}

.login-action {
  padding-top: 16px;
}

.login-loading { flex: 1; }

/* ── Toast Notification ────────────────────── */
.toast-notification {
  position: absolute;
  top: 66px;
  left: 16px;
  right: 16px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px -6px rgba(0,0,0,.18);
  transition: all var(--duration-normal) var(--ease-out);
}

.toast-success {
  background: #065F46;
  color: #D1FAE5;
}

.toast-error {
  background: #991B1B;
  color: #FEE2E2;
}

.toast-icon {
  flex: none;
  display: grid;
  place-items: center;
}

.toast-message {
  flex: 1;
  line-height: 1.4;
}

.toast-enter {
  opacity: 0;
  transform: translateY(-20px) scale(0.95);
}

.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-exit {
  opacity: 0;
  transform: translateY(-10px) scale(0.98);
  transition: all 300ms var(--ease-out);
}

/* ── Animations ────────────────────────────── */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.anim-fade-up {
  animation: fadeUp var(--duration-slow) var(--ease-out) both;
}

.anim-fade-in {
  animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.anim-slide-up {
  animation: slideUp var(--duration-slow) var(--ease-out) both;
}

/* ── Home Indicator ─────────────────────────── */
.screen::after {
  content: '';
  position: absolute;
  bottom: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 138px;
  height: 5px;
  border-radius: 3px;
  background: #1A2731;
  opacity: 0.85;
  z-index: 9;
  pointer-events: none;
}

/* ── Icon Defaults ─────────────────────────── */
.icon {
  display: inline-block;
  vertical-align: middle;
  flex: none;
}
