/* ============================================================
   DncWeather · consumo de API — visual meteorológico
   Céu animado · vidro · tipografia Oswald + Inter
   ============================================================ */
:root {
  --navy: #0b2a4a;
  --navy-2: #103a63;
  --sky: #2f7fc4;
  --sun: #ffcf4d;
  --ink: #0f1e2e;
  --muted: #5b7290;
  --card: rgba(255, 255, 255, 0.92);
  --line: rgba(255, 255, 255, 0.5);
  --radius: 22px;
  --max: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, sans-serif;
  color: var(--ink);
  min-height: 100vh;
  background: linear-gradient(180deg, #0b2a4a 0%, #1c5b96 45%, #7db9e8 100%);
  background-attachment: fixed;
}
.wrap { max-width: var(--max); margin: 0 auto; padding-left: 24px; padding-right: 24px; }

/* ---------- Céu animado ---------- */
.sky { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.sun {
  position: absolute; top: 8%; right: 10%;
  width: 130px; height: 130px; border-radius: 50%;
  background: radial-gradient(circle, #fff6d8 0%, var(--sun) 45%, rgba(255, 207, 77, 0) 72%);
  box-shadow: 0 0 90px 30px rgba(255, 207, 77, 0.35);
  animation: sunPulse 6s ease-in-out infinite;
}
@keyframes sunPulse { 50% { transform: scale(1.06); } }
.cloud {
  position: absolute; width: 220px; height: 64px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.85);
  filter: blur(1px); opacity: 0.9;
  animation: drift linear infinite;
}
.cloud::before, .cloud::after {
  content: ''; position: absolute; border-radius: 50%; background: rgba(255, 255, 255, 0.85);
}
.cloud::before { width: 90px; height: 90px; top: -44px; left: 30px; }
.cloud::after { width: 60px; height: 60px; top: -28px; right: 34px; }
.c1 { top: 16%; animation-duration: 55s; }
.c2 { top: 38%; animation-duration: 80s; animation-delay: -30s; transform: scale(0.7); }
.c3 { top: 60%; animation-duration: 100s; animation-delay: -60s; transform: scale(1.25); opacity: 0.6; }
@keyframes drift { from { left: -260px; } to { left: 110%; } }

/* ---------- Topo ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 42, 74, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { color: #fff; text-decoration: none; font-size: 1.35rem; font-weight: 800; }
.brand i { color: var(--sun); margin-right: 8px; }
.brand strong { font-weight: 400; }
.nav nav { display: flex; gap: 26px; }
.nav nav a { color: #cfe3f5; text-decoration: none; font-size: 0.9rem; font-weight: 600; }
.nav nav a:hover { color: #fff; }

/* ---------- Hero ---------- */
main { position: relative; z-index: 1; }
.hero { text-align: center; padding: 72px 24px 30px; color: #fff; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 8px 18px; border-radius: 999px; backdrop-filter: blur(8px);
}
.hero h1 {
  font-family: 'Oswald', sans-serif; font-weight: 600;
  font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02;
  margin: 22px 0 12px; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}
.hero > p { color: #dbe9f6; max-width: 560px; margin: 0 auto; }

/* ---------- Busca ---------- */
.search-card {
  background: var(--card); backdrop-filter: blur(16px);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(4, 20, 38, 0.35);
  max-width: 640px; margin: 32px auto 0; padding: 28px;
  display: grid; gap: 14px; text-align: left;
}
.field { display: grid; gap: 6px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.field input {
  font-family: inherit; font-size: 1rem; font-weight: 600; color: var(--ink);
  border: 2px solid #dbe6f2; border-radius: 14px; background: #f4f8fc;
  padding: 13px 16px; width: 100%; transition: border-color 0.25s, box-shadow 0.25s;
}
.field input:focus { outline: none; border-color: var(--sky); box-shadow: 0 0 0 4px rgba(47, 127, 196, 0.18); }
.error { color: #d92d20; font-size: 0.85rem; font-weight: 600; min-height: 1.2em; }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.btn-primary, .btn-ghost {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: inherit; font-weight: 700; font-size: 0.95rem;
  border-radius: 14px; padding: 14px 26px; cursor: pointer; border: none;
  transition: transform 0.25s, box-shadow 0.25s;
}
.btn-primary { background: linear-gradient(135deg, #ffb020, #ff8a00); color: #3a2200; box-shadow: 0 12px 28px rgba(255, 138, 0, 0.4); }
.btn-primary:hover { transform: translateY(-2px); }
.btn-primary:disabled { opacity: 0.6; cursor: wait; transform: none; }
.btn-ghost { background: #eaf3fb; color: var(--navy); border: 2px solid #dbe6f2; }
.btn-ghost:hover { border-color: var(--sky); }

/* ---------- Resultado ---------- */
.hidden { display: none; }
#resultado { padding: 26px 24px 10px; }
.now-card {
  background: linear-gradient(135deg, rgba(11,42,74,.94), rgba(28,91,150,.94));
  color: #fff; border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius); padding: 34px;
  display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap;
  box-shadow: 0 24px 60px rgba(4, 20, 38, 0.4);
}
.now-main { display: flex; align-items: center; gap: 20px; }
.now-main i { font-size: 4rem; color: var(--sun); filter: drop-shadow(0 6px 18px rgba(255, 207, 77, 0.5)); }
.now-main strong { display: block; font-family: 'Oswald', sans-serif; font-size: 4rem; font-weight: 500; line-height: 1; }
.now-main span { color: #cfe3f5; }
.now-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 28px; font-size: 0.92rem; }
.now-meta i { color: var(--sun); margin-right: 8px; width: 18px; }

#resultado h2 { color: #fff; font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 1.4rem; margin: 34px 0 16px; text-shadow: 0 2px 14px rgba(0,0,0,.3); }
#resultado h2 i { color: var(--sun); margin-right: 10px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; }
.day {
  background: var(--card); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 8px; text-align: center; backdrop-filter: blur(10px);
  transition: transform 0.25s;
}
.day:hover { transform: translateY(-4px); }
.day small { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.day i { font-size: 1.6rem; color: var(--sky); margin: 10px 0; }
.day strong { display: block; font-size: 0.95rem; }
.day span { font-size: 0.8rem; color: var(--muted); }

.addr-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px;
  backdrop-filter: blur(10px);
}
.addr-card small { display: block; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.addr-card strong { font-size: 1rem; }

/* ---------- Alertas ---------- */
.alerts {
  margin: 40px 0 60px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 34px; display: grid; grid-template-columns: 1fr 1.4fr; gap: 26px; align-items: center;
  backdrop-filter: blur(10px);
}
.alerts h2 { font-family: 'Oswald', sans-serif; font-weight: 500; font-size: 1.6rem; }
.alerts p { color: var(--muted); font-size: 0.92rem; }
.alerts form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; }
.alerts input {
  font-family: inherit; font-size: 0.9rem;
  border: 2px solid #dbe6f2; border-radius: 12px; background: #f4f8fc;
  padding: 12px 16px; width: 100%;
}
.alerts input:focus { outline: none; border-color: var(--sky); }
.alerts button {
  font-family: inherit; font-weight: 700; font-size: 0.9rem; cursor: pointer;
  background: var(--navy); color: #fff; border: none; border-radius: 12px; padding: 12px 22px;
  transition: transform 0.25s;
}
.alerts button:hover { transform: translateY(-2px); }
.ok { color: #067647; font-weight: 600; font-size: 0.9rem; }

/* ---------- Rodapé ---------- */
footer { position: relative; z-index: 1; background: rgba(11, 42, 74, 0.9); backdrop-filter: blur(10px); }
.foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding-top: 20px; padding-bottom: 20px; color: #cfe3f5; font-size: 0.82rem; }
.foot i { color: var(--sun); margin-right: 6px; }

/* ---------- Responsivo ---------- */
@media (max-width: 860px) {
  .nav nav { display: none; }
  .week { grid-template-columns: repeat(4, 1fr); }
  .addr-card { grid-template-columns: 1fr; }
  .alerts { grid-template-columns: 1fr; }
  .alerts form { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .now-card { flex-direction: column; text-align: center; }
  .now-main { flex-direction: column; }
}
@media (max-width: 520px) {
  .week { grid-template-columns: repeat(2, 1fr); }
  .sun { width: 90px; height: 90px; }
}
