@font-face { font-family: "Outfit"; font-weight: 500; font-style: normal; font-display: swap; src: url(../fonts/outfit-500.ttf) format("truetype"); }
@font-face { font-family: "Outfit"; font-weight: 700; font-style: normal; font-display: swap; src: url(../fonts/outfit-700.ttf) format("truetype"); }

:root {
  /* Brand: teal taken from the Oroi logo. Weather colors are semantic, separate from the brand. */
  --brand: #0e7584;
  --brand-ink: #0b4f5b;
  --ink: #0e2e38;
  --ink-soft: #4a6670;
  --card: #ffffff;
  --line: #dbe8ea;
  --ok: #2a9d57;
  --slow: #e49a14;
  --down: #d3392f;
  --none: #d5dde0;
  --radius: 16px;
  --font-display: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: #d9f1f3;
  line-height: 1.5;
}

h1, h2, h3, .footer-title { font-family: var(--font-display); text-wrap: balance; }

/* ---------- sky: background follows the overall weather ---------- */
.sky {
  min-height: 100vh;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #7fd3e2 0%, #c9eef0 38%, #f0fbfa 100%);
  transition: background .8s ease;
}
.sky-cloudy  { background: linear-gradient(180deg, #a3bcc4 0%, #d0dfe2 40%, #eef4f5 100%); }
.sky-stormy  { background: linear-gradient(180deg, #465b66 0%, #7a8d96 42%, #bcc8cd 100%); }
.sky-unknown { background: linear-gradient(180deg, #b6c3c8 0%, #dbe3e6 42%, #f1f4f5 100%); }

/* ---------- header ---------- */
.topbar { background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 2px 14px rgba(14, 46, 56, .08); }
.topbar-in {
  max-width: 960px; margin: 0 auto; padding-block: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand-logo { height: 38px; width: auto; display: block; }

.langs { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: #eef4f5; }
.lang {
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; letter-spacing: .04em;
  min-width: 38px; min-height: 32px; padding: 0 10px; border-radius: 999px; border: 0;
  background: transparent; color: var(--ink-soft);
}
.lang:hover { color: var(--ink); }
.lang.active { background: var(--brand); color: #fff; }
.lang:focus-visible, .btn:focus-visible { outline: 3px solid #1b6ef3; outline-offset: 2px; }

/* ---------- layout ---------- */
.wrap {
  flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding-block: 8px 40px;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------- hero ---------- */
.hero { text-align: center; padding: 28px 0 20px; }
.hero h1 { margin: 14px 0 4px; font-size: clamp(2.1rem, 6vw, 3.4rem); line-height: 1.05; font-weight: 700; }
.hero-desc { margin: 0 auto; max-width: 34em; font-size: clamp(1.05rem, 2.5vw, 1.3rem); font-weight: 500; font-family: var(--font-display); }
.updated { margin: 14px 0 0; font-size: .85rem; opacity: .8; }
.sky-stormy .hero { color: #fff; }

.chips { list-style: none; margin: 18px 0 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 14px; border-radius: 999px; background: rgba(255, 255, 255, .85); color: var(--ink); font-size: .9rem; border: 1px solid transparent; }
.chip b { font-family: var(--font-display); font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.chip-sunny b { color: var(--ok); }
.chip-cloudy b { color: #b87400; }
.chip-stormy b { color: var(--down); }

.affected { margin: 12px auto 0; max-width: 40em; padding: 8px 14px; border-radius: 12px; background: rgba(255, 255, 255, .92); color: var(--ink); font-size: .95rem; font-weight: 600; }

.state-msg { text-align: center; padding: 24px; background: var(--card); border-radius: var(--radius); }
.btn { font: inherit; font-weight: 700; cursor: pointer; padding: 10px 18px; border: 0; border-radius: 999px; background: var(--brand); color: #fff; }

/* ---------- legend ---------- */
.legend {
  list-style: none; margin: 8px 0 0; padding: 10px 14px; border-radius: 12px; background: rgba(255, 255, 255, .8);
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; font-size: .82rem; color: var(--ink);
}
.legend-title { font-weight: 700; }
.legend li { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 14px; border-radius: 2px; display: inline-block; }

/* ---------- groups / cards ---------- */
.group { margin-top: 26px; }
.group h2 { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px 2px; letter-spacing: .02em; }
.sky-stormy .group h2 { color: #fff; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 14px; }
.card { background: var(--card); border-radius: var(--radius); padding: 16px; box-shadow: 0 4px 18px rgba(14, 46, 56, .1); outline: 2px solid transparent; }
/* Only services that need attention get a colored ring: attention is encoded in form, not by painting every card. */
.card.w-cloudy { outline-color: var(--slow); }
.card.w-stormy { outline-color: var(--down); }

.card-head { display: flex; align-items: center; gap: 12px; }
.card-head > div { min-width: 0; }
.card-head h3 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 700; }
.pill { display: inline-block; font-size: .76rem; font-weight: 700; padding: 2px 10px; border-radius: 999px; color: #fff; background: var(--none); }
.pill-sunny { background: var(--ok); }
.pill-cloudy { background: #b87400; }
.pill-stormy { background: var(--down); }
.pill-unknown { color: var(--ink); }

.avail { margin: 8px 0 0; font-size: .8rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }

/* 90 day strip */
.strip { display: grid; grid-template-columns: repeat(90, 1fr); gap: 2px; margin-top: 14px; height: 26px; }
.day { border-radius: 2px; background: var(--none); }
.d-sunny { background: var(--ok); }
.d-cloudy { background: var(--slow); }
.d-stormy { background: var(--down); }
.d-unknown { background: var(--none); }

/* incidents */
.empty { margin: 0; padding: 16px; background: var(--card); border-radius: var(--radius); }
.incidents { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.incidents li { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; background: var(--card); border-radius: 12px; border-left: 5px solid var(--ok); }
.incidents li.ongoing { border-left-color: var(--down); }
.incidents li span { font-size: .85rem; color: var(--ink-soft); }

/* ---------- footer ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); }
.footer-in {
  max-width: 960px; margin: 0 auto; padding-block: 28px 24px; text-align: center;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.footer-title { margin: 0 0 16px; font-size: .8rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-soft); }
.brands { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 20px 40px; }
.brands img { height: 34px; width: auto; display: block; }
.copyright { margin: 20px 0 0; font-size: .78rem; color: var(--ink-soft); }

/* ---------- weather icons (pure CSS) ---------- */
.wx { position: relative; width: 56px; height: 56px; flex: none; }
.wx-large { width: 120px; height: 120px; margin: 0 auto; }

.sun { position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #ffe27a, #ffb81f); box-shadow: 0 0 18px 4px rgba(255, 184, 31, .55); }
.sun i { position: absolute; inset: -32%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, rgba(255, 184, 31, .95) 0 6deg, transparent 6deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 58%, #000 60%, #000 78%, transparent 80%);
          mask: radial-gradient(circle, transparent 58%, #000 60%, #000 78%, transparent 80%);
  animation: spin 24s linear infinite; }
.sun.small { inset: 0 38% 38% 0; }
.sun.small i { display: none; }

.cloud { position: absolute; left: 8%; right: 0; bottom: 8%; height: 46%; border-radius: 999px; background: #fff; box-shadow: 0 4px 10px rgba(14, 46, 56, .18); animation: drift 6s ease-in-out infinite alternate; }
.cloud::before, .cloud::after { content: ""; position: absolute; background: inherit; border-radius: 50%; }
.cloud::before { width: 52%; height: 130%; left: 14%; bottom: 30%; }
.cloud::after { width: 38%; height: 100%; right: 12%; bottom: 36%; }
.cloud.dark { background: #5b6678; bottom: 22%; }
.cloud.faint { background: #e5e9ee; left: 0; bottom: 20%; }

.bolt { position: absolute; left: 40%; top: 52%; width: 22%; height: 44%; background: #ffd23f;
  clip-path: polygon(55% 0, 0 58%, 42% 58%, 25% 100%, 100% 38%, 58% 38%); animation: flash 2.6s steps(1) infinite; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift { to { transform: translateX(6%); } }
@keyframes flash { 0%, 78%, 84%, 100% { opacity: 1; } 80%, 90% { opacity: .15; } }

@media (prefers-reduced-motion: reduce) {
  .sun i, .cloud, .bolt { animation: none; }
  .sky { transition: none; }
}

@media (max-width: 480px) {
  .brand-logo { height: 30px; }
  .strip { height: 22px; }
  .brands { gap: 18px 28px; }
  .brands img { height: 28px; }
}

/* ---------- boot + error ui ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; background: #7fd3e2; }
.boot-sun { width: 64px; height: 64px; border-radius: 50%; background: #ffb81f; animation: pulse 1.2s ease-in-out infinite alternate; }
@keyframes pulse { to { transform: scale(1.2); } }

#blazor-error-ui {
  display: none; position: fixed; inset: auto 0 0 0; padding: 12px 20px; z-index: 1000;
  background: #fff3cd; color: #5c4400; box-shadow: 0 -2px 8px rgba(0, 0, 0, .2);
}
#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: 12px; top: 10px; }

/* ---------- sign-in gate ---------- */
.topbar-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.who { font-size: .8rem; color: var(--ink-soft); max-width: 14em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.link-btn { font: inherit; font-size: .8rem; font-weight: 700; color: var(--brand); background: none; border: 0; padding: 6px 4px; cursor: pointer; text-decoration: underline; }
.link-btn:focus-visible { outline: 3px solid #1b6ef3; outline-offset: 2px; }

.gate { max-width: 520px; margin: 48px auto 0; padding: 32px 24px; text-align: center; background: var(--card); border-radius: var(--radius); box-shadow: 0 6px 24px rgba(14, 46, 56, .12); }
.gate h1 { margin: 0 0 8px; font-size: clamp(1.5rem, 4.5vw, 2rem); line-height: 1.15; }
.gate p { margin: 0 0 20px; }
.g-btn { display: flex; justify-content: center; min-height: 44px; margin-bottom: 18px; }
.gate .gate-note { margin: 0; font-size: .8rem; color: var(--ink-soft); }
.gate .gate-error { padding: 10px 14px; border-radius: 10px; background: #fff3cd; color: #5c4400; font-size: .9rem; }

@media (max-width: 480px) {
  .who { display: none; }
  .gate { margin-top: 24px; padding: 24px 16px; }
}
.sky-gate { background: linear-gradient(180deg, #7fd3e2 0%, #c9eef0 38%, #f0fbfa 100%); }
