:root {
  color-scheme: light dark;
  --glass-bg: rgba(255, 255, 255, 0.16);
  --glass-border: rgba(255, 255, 255, 0.35);
  --text: #ffffff;
  --text-dim: rgba(255, 255, 255, 0.72);
  --danger: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* iOS 7-11 style soft aurora background: layered blurred gradient blobs, slow drift */
.aurora-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: linear-gradient(160deg, #2b2f77 0%, #5b3a8e 45%, #b45b8f 100%);
  overflow: hidden;
}

.aurora-bg span {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.65;
  animation: drift 26s ease-in-out infinite alternate;
}

.aurora-bg span:nth-child(1) {
  width: 55vmax;
  height: 55vmax;
  top: -18vmax;
  left: -12vmax;
  background: #6ea8ff;
  animation-duration: 30s;
}

.aurora-bg span:nth-child(2) {
  width: 60vmax;
  height: 60vmax;
  bottom: -22vmax;
  right: -18vmax;
  background: #ff9ecf;
  animation-duration: 34s;
  animation-delay: -6s;
}

.aurora-bg span:nth-child(3) {
  width: 40vmax;
  height: 40vmax;
  top: 30%;
  left: 55%;
  background: #9b7bff;
  animation-duration: 24s;
  animation-delay: -12s;
}

@keyframes drift {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(6%, 8%) scale(1.08);
  }
}

.screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  border-radius: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

/* Login */
#login-card {
  width: 100%;
  max-width: 360px;
  padding: 36px 32px;
  text-align: center;
}

#login-card h1 {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 4px;
}

#login-card p.subtitle {
  margin: 0 0 28px;
  color: var(--text-dim);
  font-size: 14px;
}

.field {
  text-align: left;
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.12);
  color: var(--text);
  font-size: 15px;
  outline: none;
}

.field input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

.field input:focus {
  border-color: rgba(255, 255, 255, 0.7);
}

button {
  cursor: pointer;
  font-family: inherit;
}

.primary-btn {
  width: 100%;
  padding: 13px;
  margin-top: 8px;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  color: #3a2a5d;
  font-size: 15px;
  font-weight: 600;
}

.primary-btn:disabled {
  opacity: 0.6;
}

#login-error {
  margin-top: 14px;
  font-size: 13px;
  color: var(--danger);
  min-height: 16px;
}

/* Dashboard */
#dashboard {
  width: 100%;
  max-width: 480px;
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 4px 4px 0;
}

.dash-header h1 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.dash-header .date {
  color: var(--text-dim);
  font-size: 13px;
}

#logout-btn {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text);
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 13px;
}

.card {
  padding: 20px 22px;
}

.card h2 {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  margin: 0 0 14px;
  font-weight: 600;
}

.empty-state {
  color: var(--text-dim);
  font-size: 14px;
  padding: 4px 0;
}

.reminder-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 15px;
}

.reminder-row:last-child {
  border-bottom: none;
}

.reminder-row > span:first-child {
  flex: 1;
}

.reminder-row .time {
  color: var(--text-dim);
  white-space: nowrap;
  font-size: 13px;
}

.task-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 15px;
}

.task-row:last-child {
  border-bottom: none;
}

.delete-btn {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 20px;
  line-height: 1;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

.delete-btn:hover {
  background: rgba(255, 107, 107, 0.25);
  color: #ffb3b3;
}

.task-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  position: relative;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.task-row input[type="checkbox"]:checked {
  background: #9b7bff;
  border-color: #9b7bff;
}

.task-row input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.task-row label {
  flex: 1;
  cursor: pointer;
}

.refresh-note {
  text-align: center;
  font-size: 11px;
  color: var(--text-dim);
  padding-bottom: 8px;
}
