:root {
  color-scheme: light dark;
  --bg: #f2f5fb;
  --card-bg: #ffffff;
  --text: #1c2333;
  --muted: #667085;
  --accent: #3468f0;
  --accent-soft: #e7edfe;
  --danger: #d64545;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(30, 41, 59, 0.08);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10131c;
    --card-bg: #1a2033;
    --text: #e9edf7;
    --muted: #99a3b8;
    --accent: #6d92ff;
    --accent-soft: #232c47;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Yu Gothic UI", "Segoe UI", system-ui, sans-serif;
  display: flex;
  justify-content: center;
  padding: 32px 16px 64px;
}

.app {
  width: 100%;
  max-width: 480px;
}

header {
  text-align: center;
  margin-bottom: 24px;
}

h1 {
  font-size: 1.6rem;
  margin: 0 0 4px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.search-form {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

#zipcode-input {
  flex: 1;
  padding: 12px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(120, 130, 150, 0.3);
  background: var(--card-bg);
  color: var(--text);
  font-size: 1rem;
  outline: none;
}

#zipcode-input:focus {
  border-color: var(--accent);
}

#search-btn {
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius);
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

#search-btn:hover {
  opacity: 0.9;
}

#search-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.status {
  text-align: center;
  padding: 12px 16px;
  border-radius: var(--radius);
  background: var(--card-bg);
  color: var(--muted);
  margin-bottom: 16px;
  font-size: 0.9rem;
}

.status.error {
  color: var(--danger);
}

.result {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.address-card,
.current-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  text-align: center;
}

.address-label {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.address-text {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 600;
}

.weather-icon {
  font-size: 3rem;
  margin: 0;
  line-height: 1;
}

.current-temp {
  font-size: 2.4rem;
  font-weight: 700;
  margin: 8px 0 0;
}

.current-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.current-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.forecast-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;
}

.forecast-day {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 8px;
  text-align: center;
}

.forecast-day .day-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0 0 4px;
}

.forecast-day .day-icon {
  font-size: 1.5rem;
  margin: 0 0 4px;
}

.forecast-day .day-temps {
  font-size: 0.8rem;
  margin: 0;
}

.forecast-day .day-temps .max {
  font-weight: 700;
}

.forecast-day .day-temps .min {
  color: var(--muted);
}
