*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #0f0f12;
  --surface: #1a1a21;
  --text: #f2f2f5;
  --muted: #8b8b9a;
  --accent: #6ee7b7;
  --accent-dim: #34d399;
  --danger: #f87171;
  --radius: 12px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 1.5rem;
}

.clock-app {
  width: min(100%, 22rem);
  text-align: center;
}

.title {
  font-size: clamp(0.75rem, 3.5vw, 0.875rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.time {
  font-size: clamp(3rem, 12vw, 4.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 300;
  letter-spacing: -0.02em;
  margin: 0;
  line-height: 1.1;
}

.date {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0.5rem 0 2rem;
}

.alarm-panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem 1.5rem;
}

.alarm-label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.alarm-input {
  width: 100%;
  font: inherit;
  font-size: 1.5rem;
  font-variant-numeric: tabular-nums;
  text-align: center;
  padding: 0.6rem;
  border: 1px solid #2e2e38;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  color-scheme: dark;
}

.alarm-input:focus {
  outline: 2px solid var(--accent-dim);
  outline-offset: 2px;
}

.actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.btn {
  flex: 1;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 1rem;
  border: 1px solid #2e2e38;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.btn:hover:not(:disabled) {
  border-color: var(--muted);
}

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

.btn-primary {
  background: var(--accent-dim);
  border-color: var(--accent-dim);
  color: #052e1f;
  font-weight: 600;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent);
  border-color: var(--accent);
}

.btn-large {
  flex: none;
  width: 100%;
  padding: 0.85rem;
  font-size: 1rem;
}

.status {
  margin: 1rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

.status.active {
  color: var(--accent);
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 100;
}

.overlay.hidden {
  display: none;
}

.overlay-card {
  background: var(--surface);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  width: min(100%, 18rem);
  text-align: center;
  animation: pulse-border 1s ease-in-out infinite;
}

@keyframes pulse-border {
  50% {
    border-color: #fca5a5;
    box-shadow: 0 0 24px rgba(248, 113, 113, 0.35);
  }
}

.overlay-title {
  font-size: 1.75rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
  color: var(--danger);
}

.overlay-time {
  font-size: 2rem;
  font-variant-numeric: tabular-nums;
  margin: 0 0 1.5rem;
}

.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;
}
