/* ============================================
   Skincare Alarm — Mobile-first styles
   ============================================ */

:root {
  --bg: #fdf6f0;
  --bg-soft: #f7ece2;
  --card: #ffffff;
  --border: #f0e2d4;
  --text: #3d2c26;
  --text-dim: #8a7a70;
  --accent: #e8657d;
  --accent-2: #f4a261;
  --success: #2fbf8f;
  --morning: #f4a261;
  --evening: #7c6fd0;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 24px rgba(120, 80, 60, 0.08);
  --font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  background-image:
    radial-gradient(ellipse at 15% -10%, rgba(232, 101, 125, 0.14), transparent 55%),
    radial-gradient(ellipse at 95% 30%, rgba(244, 162, 97, 0.12), transparent 50%),
    radial-gradient(ellipse at 50% 115%, rgba(124, 111, 208, 0.08), transparent 55%);
  background-attachment: fixed;
}

.container {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== HEADER ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(253, 246, 240, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
}

.logo {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
}

.today-date {
  font-size: 0.78rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== CARDS ===== */
main {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-top: 18px;
  padding-bottom: 48px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 18px;
  box-shadow: var(--shadow);
}

.section-head h2 {
  font-size: 1.25rem;
  margin-bottom: 4px;
}

.section-desc {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin-bottom: 14px;
}

/* ===== HERO ===== */
.hero {
  text-align: center;
  padding-top: 30px;
  padding-bottom: 28px;
}

.hero-kicker {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.hero-title {
  font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.gradient-text {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

.hero-sub {
  color: var(--text-dim);
  font-size: 0.95rem;
  max-width: 500px;
  margin: 0 auto;
}

/* ===== ALARM ===== */
.alarm-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

.alarm-block {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
}

.alarm-block.alarm-morning {
  border-left: 4px solid var(--morning);
}

.alarm-block.alarm-evening {
  border-left: 4px solid var(--evening);
}

.alarm-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.alarm-info {
  flex: 1;
  min-width: 0;
}

.alarm-info strong {
  display: block;
  font-size: 0.95rem;
}

.alarm-info small {
  display: block;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.4;
}

.time-input {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  outline: none;
  min-width: 110px;
  -webkit-tap-highlight-color: transparent;
}

.time-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(232, 101, 125, 0.15);
}

.alarm-note {
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--text-dim);
  text-align: center;
}

.alarm-note.is-active {
  color: var(--success);
  font-weight: 600;
}

.alarm-status {
  margin-top: 14px;
  padding: 12px 14px;
  background: rgba(47, 191, 143, 0.1);
  border: 1px solid rgba(47, 191, 143, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  color: #1f7a5b;
}

/* ===== BUTTONS ===== */
.btn {
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 13px 20px;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease, opacity 0.12s ease;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  color: #fff;
  box-shadow: 0 6px 18px rgba(232, 101, 125, 0.35);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: default;
  transform: none;
}

/* ===== ROUTINE TABS ===== */
.routine-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 5px;
}

.routine-tab {
  flex: 1;
  font-family: inherit;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 10px;
  border: none;
  border-radius: 9px;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.routine-tab.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 2px 8px rgba(120, 80, 60, 0.12);
}

.routine-tab[data-routine="morning"].is-active {
  color: #b25e1e;
}

.routine-tab[data-routine="evening"].is-active {
  color: #55489d;
}

/* ===== ROUTINE LIST ===== */
.routine-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.routine-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  animation: slide-in 0.25s ease;
}

.routine-item.is-done {
  opacity: 0.65;
}

.routine-item.is-done .routine-text {
  text-decoration: line-through;
  color: var(--text-dim);
}

.routine-check {
  width: 26px;
  height: 26px;
  min-width: 26px;
  border-radius: 9px;
  border: 2px solid var(--border);
  background: #fff;
  cursor: pointer;
  font-size: 0.85rem;
  color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.routine-item.is-done .routine-check {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.routine-text {
  flex: 1;
  font-size: 0.95rem;
  word-break: break-word;
}

.routine-tip {
  font-size: 0.78rem;
  color: var(--text-dim);
  display: block;
}

/* ===== ROUTINE PROGRESS ===== */
.routine-progress {
  display: flex;
  align-items: center;
  gap: 12px;
}

.routine-progress-track {
  flex: 1;
  height: 10px;
  background: var(--bg-soft);
  border-radius: 999px;
  overflow: hidden;
}

.routine-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--success), var(--accent-2));
  border-radius: 999px;
  transition: width 0.3s ease;
}

.routine-progress span {
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ===== GUIDE ===== */
.guide-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0;
  overflow: hidden;
}

.guide-item summary {
  list-style: none;
  cursor: pointer;
  padding: 14px;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 8px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.guide-item summary::-webkit-details-marker {
  display: none;
}

.guide-item summary::after {
  content: "▾";
  margin-left: auto;
  color: var(--text-dim);
  transition: transform 0.15s ease;
}

.guide-item[open] summary::after {
  transform: rotate(180deg);
}

.guide-item p {
  padding: 0 14px 14px;
  font-size: 0.88rem;
  color: var(--text-dim);
  line-height: 1.6;
}

.guide-item p strong {
  color: var(--text);
}

/* ===== TIPS ===== */
.tips-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tips-list li {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 0.9rem;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: #fff;
  padding: 14px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  z-index: 100;
  max-width: calc(100vw - 40px);
  text-align: center;
  animation: toast-in 0.25s ease;
}

.toast.is-morning {
  background: linear-gradient(90deg, #e88b3a, var(--morning));
}

.toast.is-evening {
  background: linear-gradient(90deg, #6f63c9, var(--evening));
}

/* ===== FOOTER ===== */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 40px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-tagline {
  margin-top: 6px;
  font-weight: 600;
  color: var(--text);
}

/* ===== ANIMATIONS ===== */
@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .card {
    padding: 28px 26px;
  }
}

@media (min-width: 768px) {
  main {
    max-width: 860px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .hero {
    grid-column: 1 / -1;
  }

  .guide-list,
  .tips-list {
    grid-column: 1 / -1;
  }

  .site-footer {
    max-width: 860px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* Safe area for notched phones */
@supports (padding: max(0px)) {
  .site-header .header-inner {
    padding-top: max(14px, env(safe-area-inset-top));
  }

  main {
    padding-bottom: max(48px, env(safe-area-inset-bottom));
  }

  .toast {
    bottom: max(20px, env(safe-area-inset-bottom));
  }
}
