:root {
  --bg: #FFF8F5;
  --surface: #FFFFFF;
  --surface-alt: #F5EDE8;
  --border: #E8DDD8;
  --text-1: #2D2D2D;
  --text-2: #7A6E6A;
  --ring-track: #EDE0DA;
  --shadow: 0 2px 16px rgba(0,0,0,0.06);
  --accent: #FF6B47;
  --accent-work: #FF6B47;
  --accent-flow: #8B5CF6;
  --danger: #C94B4B;
  --google-blue: #4285F4;
  --google-red: #DB4437;
  --google-yellow: #F4B400;
  --google-green: #0F9D58;
  --google-button-bg: #FFFFFF;
  --google-button-text: #2D2D2D;
  --radius: 8px;
  --font-ui: "DM Sans", system-ui, sans-serif;
  --font-timer: "DM Mono", ui-monospace, monospace;
}

[data-theme="dark"] {
  --bg: #1B2537;
  --surface: #232E42;
  --surface-alt: #2A3750;
  --border: #2F3F58;
  --text-1: #E2EAF4;
  --text-2: #8A9BB5;
  --ring-track: #2A3750;
  --shadow: 0 2px 20px rgba(0,0,0,0.3);
  --accent-work: #38C9A8;
  --accent-flow: #C084FC;
  --danger: #FF8B8B;
}

body[data-phase="work"] { --accent: var(--accent-work); }
body[data-phase="short_break"] { --accent: #F0A500; }
body[data-phase="long_break"] { --accent: #4CAF8A; }
body[data-phase="flow"] { --accent: var(--accent-flow); }
body[data-phase="flow-break"] { --accent: #4CAF8A; }
[data-theme="dark"] body[data-phase="short_break"] { --accent: #5BB8E8; }
[data-theme="dark"] body[data-phase="long_break"],
[data-theme="dark"] body[data-phase="flow-break"] { --accent: #9B8AE8; }

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-height: 100%; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }
body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text-1);
  font-family: var(--font-ui);
  letter-spacing: 0;
}
button, input { font: inherit; }
button {
  min-height: 44px;
  border: 0;
  color: inherit;
  cursor: pointer;
}
button:disabled { cursor: not-allowed; opacity: 0.45; }
input {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-1);
}
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
.flash-overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  pointer-events: none;
  background: var(--accent);
  opacity: 0;
}
.flash-overlay.flash { animation: flash 400ms ease-out; }
@keyframes flash {
  0% { opacity: 0; }
  45% { opacity: 0.35; }
  100% { opacity: 0; }
}
.signin-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--bg);
}
.signin-card {
  width: min(100%, 360px);
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.signin-card h1 {
  margin: 0 0 10px;
  font-family: var(--font-timer);
  font-size: 36px;
  font-weight: 500;
}
.signin-card p {
  margin: 0 0 22px;
  color: var(--text-2);
}
.google-button {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--google-button-bg);
  color: var(--google-button-text);
  font-weight: 500;
}
.google-g {
  font-weight: 500;
  color: var(--google-blue);
}
.google-g span {
  background: linear-gradient(90deg, var(--google-blue), var(--google-red), var(--google-yellow), var(--google-green));
  background-clip: text;
  color: transparent;
}
.auth-message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 14px;
}
