* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

:root {
  --bg: #0a1628;
  --surface: #122040;
  --surface2: #1a2d54;
  --text: #f0f6ff;
  --text-muted: #6b82a8;
  --on-color: #06b6d4;
  --off-track: #2d3f5e;
  --radius: 20px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  overflow: hidden;
}

.app {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ── Header ── */

header {
  padding: 48px 0 28px;
}

h1 {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 22px;
}

.temps {
  display: flex;
  gap: 28px;
}

.temp-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.temp-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.temp-value {
  font-size: 26px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

/* ── Cards ── */

main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 16px;
}

.card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px 24px;
  border: 1.5px solid transparent;
  transition: border-color 0.25s, background 0.25s;
}

.card.active {
  border-color: var(--on-color);
  background: var(--surface2);
}

.card-icon {
  font-size: 30px;
  min-width: 38px;
  text-align: center;
}

.card-body {
  flex: 1;
}

.card-title {
  font-size: 19px;
  font-weight: 600;
}

.card-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ── Color select ── */

.color-select {
  display: none;
  margin-top: 6px;
  background: var(--surface2);
  border: 1.5px solid var(--off-track);
  border-radius: 8px;
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  padding: 5px 8px;
  outline: none;
  cursor: pointer;
  max-width: 160px;
}

.color-select:focus {
  border-color: var(--on-color);
}

/* ── iOS-style toggle switch ── */

.switch {
  position: relative;
  display: inline-block;
  width: 58px;
  height: 32px;
  flex-shrink: 0;
  cursor: pointer;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.track {
  position: absolute;
  inset: 0;
  background: var(--off-track);
  border-radius: 16px;
  transition: background 0.25s;
}

.thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 26px;
  height: 26px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

.switch input:checked ~ .track {
  background: var(--on-color);
}

.switch input:checked ~ .thumb {
  transform: translateX(26px);
}

.switch input:disabled ~ .track {
  opacity: 0.45;
}

.switch input:disabled ~ .thumb {
  opacity: 0.45;
}

/* ── PIN screen ── */

.pin-screen {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.pin-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  width: 320px;
  padding: 48px 32px;
  background: var(--surface);
  border-radius: var(--radius);
}

.pin-icon {
  font-size: 48px;
}

.pin-title {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.pin-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-top: -6px;
}

.pin-input {
  width: 100%;
  background: var(--surface2);
  border: 1.5px solid var(--off-track);
  border-radius: 12px;
  color: var(--text);
  font-size: 22px;
  font-family: inherit;
  letter-spacing: 0.2em;
  text-align: center;
  padding: 14px 16px;
  outline: none;
  margin-top: 8px;
  transition: border-color 0.2s;
}

.pin-input:focus {
  border-color: var(--on-color);
}

.pin-error {
  font-size: 13px;
  color: #f87171;
  min-height: 18px;
}

.pin-btn {
  width: 100%;
  background: var(--on-color);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 600;
  font-family: inherit;
  padding: 15px;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s;
}

.pin-btn:active {
  opacity: 0.8;
}

.pin-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

/* ── Footer ── */

footer {
  padding: 14px 0 36px;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}
