@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Space+Grotesk:wght@400;500;600&display=swap');

:root {
  --bg: #f5f1e9;
  --ink: #1a1b1e;
  --muted: #5d5f66;
  --accent: #c44b2f;
  --accent-2: #2b6f6c;
  --card: #fffaf2;
  --border: #e0d7c8;
  --shadow: 0 18px 50px rgba(26, 27, 30, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top, #fef9f1 0%, #f3e6d8 55%, #efe1d2 100%);
}

.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding: 12px 16px;
  border-radius: 14px;
  background: rgba(255, 250, 242, 0.8);
  border: 1px solid var(--border);
  backdrop-filter: blur(6px);
}

.user-status {
  font-weight: 600;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(21, 22, 26, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
}

.auth-overlay.hidden {
  display: none;
}

.auth-card {
  width: min(420px, 100%);
  background: var(--card);
  border-radius: 20px;
  border: 1px solid var(--border);
  padding: 24px;
  box-shadow: var(--shadow);
}

.auth-card h2 {
  margin-top: 0;
}

.auth-tabs {
  display: flex;
  gap: 12px;
  margin: 16px 0;
}

.auth-tab {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.auth-tab.active {
  border-color: var(--accent);
  background: #fff0e6;
  color: var(--accent);
}

.auth-btn {
  margin-top: 16px;
  width: 100%;
}

.auth-error {
  margin-top: 10px;
  color: #b12a2a;
  font-weight: 600;
}

.muted {
  color: var(--muted);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 24px;
}

.brand-title {
  font-family: "Fraunces", serif;
  font-size: 2.2rem;
  letter-spacing: 0.02em;
}

.brand-sub {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  margin-bottom: 40px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 12px;
  color: var(--accent-2);
  margin-bottom: 12px;
}

h1 {
  font-family: "Fraunces", serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  margin: 0 0 12px;
}

.subhead {
  max-width: 520px;
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

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

.share-card {
  min-width: 260px;
}

.session-controls {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.btn {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.btn.primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #f7efe2;
}

.btn.primary:hover:not(:disabled) {
  background: #b64227;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
  font-weight: 600;
}

select,
.input {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 0.95rem;
  background: #fff;
}

.timer {
  margin-top: 20px;
  padding: 16px;
  border-radius: 16px;
  background: #fef4e5;
}

.timer-display {
  font-size: 2.4rem;
  font-family: "Fraunces", serif;
  margin-top: 8px;
}

.timer-meta {
  color: var(--muted);
  margin-top: 6px;
}

.section-header {
  margin: 32px 0 16px;
}

.section-header h2 {
  margin-bottom: 4px;
}

.weeks {
  display: grid;
  gap: 16px;
}

.tabs {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0 20px;
}

.tab-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.tab-btn.active {
  border-color: var(--accent);
  background: #fff0e6;
  color: var(--accent);
}

.tab-panel {
  margin-top: 16px;
}

.calendar-controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-label {
  font-weight: 700;
  font-size: 1.1rem;
}

.calendar-view {
  display: flex;
  gap: 8px;
}

.pill-btn {
  border: 1px solid var(--border);
  background: #fff;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
}

.pill-btn.active {
  border-color: var(--accent-2);
  background: #e3f1ef;
  color: var(--accent-2);
}

.calendar {
  display: grid;
  gap: 12px;
}

.calendar-month {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 10px;
}

.calendar-day {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 14px;
  padding: 10px;
  min-height: 90px;
}

.calendar-day.empty {
  background: transparent;
  border-style: dashed;
  color: #9a958c;
}

.calendar-day h4 {
  margin: 0 0 6px;
  font-size: 0.85rem;
  color: var(--accent-2);
}

.calendar-total {
  font-weight: 600;
  font-size: 0.95rem;
}

.calendar-week,
.calendar-day-view {
  display: grid;
  gap: 10px;
}

.streak-box {
  margin-top: 16px;
  padding: 12px;
  border-radius: 14px;
  background: #f1efe9;
  border: 1px solid var(--border);
}

.week-card {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 18px;
  background: #fff;
}

.week-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.day {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 10px;
  min-height: 90px;
  background: #faf6ef;
}

.day h4 {
  margin: 0 0 8px;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.session-chip {
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  margin-bottom: 6px;
  font-size: 0.85rem;
}

.log-list {
  display: grid;
  gap: 12px;
}

.log-item {
  background: #fff;
  border-radius: 14px;
  border: 1px solid var(--border);
  padding: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.summary-group {
  margin-top: 16px;
}

.summary-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.share-link {
  margin-top: 12px;
  word-break: break-all;
  font-size: 0.9rem;
  color: var(--accent-2);
}

.footer {
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.help-box {
  border: 1px solid var(--accent-2);
  background: #edf6f5;
  color: var(--accent-2);
  padding: 8px 12px;
  border-radius: 12px;
  font-weight: 600;
}

@media (max-width: 720px) {
  .hero {
    flex-direction: column;
    align-items: flex-start;
  }
}
