:root {
  --purple-950: #221243;
  --purple-800: #35206f;
  --purple-700: #4b2ea6;
  --purple-500: #6c4bd9;
  --purple-300: #b8a6ef;
  --purple-200: #d9cffc;
  --ink: #1f1633;
  --cream: #f7f5ff;
  --mist: rgba(255, 255, 255, 0.7);
  --shadow: rgba(42, 22, 94, 0.18);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(135deg, #f9f6ff 0%, #efe9ff 45%, #f6f1ff 100%);
  font-family: "DM Sans", sans-serif;
  position: relative;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background: radial-gradient(circle, rgba(108, 75, 217, 0.5) 0%, rgba(108, 75, 217, 0) 70%);
  top: -120px;
  right: -160px;
}

body::after {
  background: radial-gradient(circle, rgba(75, 46, 166, 0.45) 0%, rgba(75, 46, 166, 0) 70%);
  bottom: -140px;
  left: -160px;
}

.font-display {
  font-family: "Fraunces", serif;
}

.app-shell {
  position: relative;
  z-index: 1;
}

.glass-panel {
  background: var(--mist);
  border: 1px solid rgba(108, 75, 217, 0.18);
  border-radius: 24px;
  box-shadow: 0 26px 70px var(--shadow);
  backdrop-filter: blur(18px);
}

.primary-button {
  background: linear-gradient(135deg, #4b2ea6 0%, #6c4bd9 70%);
  color: #fff;
  border: none;
  border-radius: 999px;
  padding: 0.7rem 1.6rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  box-shadow: 0 20px 35px rgba(75, 46, 166, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-button:hover {
  transform: translateY(-1px) scale(1.01);
  box-shadow: 0 25px 45px rgba(75, 46, 166, 0.35);
}

.secondary-button {
  border-radius: 999px;
  border: 1px solid rgba(75, 46, 166, 0.25);
  padding: 0.65rem 1.4rem;
  font-weight: 600;
  color: var(--purple-800);
  background: rgba(255, 255, 255, 0.8);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.secondary-button:hover {
  transform: translateY(-1px);
  border-color: rgba(75, 46, 166, 0.45);
}

.input-field,
.textarea-field {
  width: 100%;
  border-radius: 18px;
  border: 1px solid rgba(75, 46, 166, 0.2);
  padding: 0.75rem 1rem;
  background: rgba(255, 255, 255, 0.85);
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-field:focus,
.textarea-field:focus {
  outline: none;
  border-color: rgba(75, 46, 166, 0.5);
  box-shadow: 0 0 0 3px rgba(75, 46, 166, 0.15);
}

.textarea-field {
  min-height: 160px;
  resize: vertical;
}

.pill {
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: rgba(75, 46, 166, 0.12);
  color: var(--purple-800);
  font-weight: 600;
  font-size: 0.75rem;
}

.note-card {
  background: rgba(255, 255, 255, 0.85);
  border-radius: 22px;
  border: 1px solid rgba(75, 46, 166, 0.12);
  padding: 1.1rem 1.2rem;
  box-shadow: 0 16px 30px rgba(38, 18, 87, 0.12);
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  animation: rise 0.4s ease both;
}

.note-title {
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--purple-950);
}

.note-meta {
  font-size: 0.78rem;
  color: rgba(33, 18, 67, 0.65);
}

.note-body {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.92rem;
  color: rgba(33, 18, 67, 0.85);
}

.note-line {
  margin: 0;
  line-height: 1.5;
}

.note-line.empty {
  height: 0.6rem;
}

.checkbox-line {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.35rem 0.5rem;
  border-radius: 14px;
  background: rgba(75, 46, 166, 0.06);
}

.checkbox-line input {
  margin-top: 0.2rem;
  accent-color: var(--purple-700);
}

.note-actions {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.note-action-button {
  border-radius: 999px;
  border: 1px solid rgba(75, 46, 166, 0.2);
  background: rgba(255, 255, 255, 0.85);
  color: var(--purple-800);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.8rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.note-action-button:hover {
  transform: translateY(-1px);
  border-color: rgba(75, 46, 166, 0.4);
}

.hero-blob {
  background: linear-gradient(120deg, rgba(108, 75, 217, 0.2), rgba(75, 46, 166, 0.05));
  border-radius: 32px;
  padding: 2rem;
  border: 1px solid rgba(75, 46, 166, 0.2);
  box-shadow: 0 20px 50px rgba(42, 22, 94, 0.18);
}

.fade-in {
  animation: floatIn 0.5s ease both;
}

#status-message[data-tone="error"] {
  color: #9c1b3f;
}

#status-message[data-tone="info"] {
  color: var(--purple-800);
}

#auth-status[data-tone="error"] {
  color: #9c1b3f;
}

#auth-status[data-tone="info"] {
  color: var(--purple-800);
}

@keyframes floatIn {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 768px) {
  .glass-panel {
    border-radius: 20px;
  }

  .note-card {
    padding: 1rem;
  }
}
