:root {
  --bg-1: #f3efe8;
  --bg-2: #dceaf0;
  --ink: #1d2128;
  --ink-soft: #404652;
  --brand: #e05035;
  --brand-dark: #b53720;
  --line: #c0cad1;
  --card: rgba(255, 255, 255, 0.88);
  --shadow: 0 30px 70px rgba(37, 48, 60, 0.2);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Space Grotesk", sans-serif;
  color: var(--ink);
  background: linear-gradient(140deg, var(--bg-1), var(--bg-2));
}

.login-page {
  display: grid;
  place-items: center;
  position: relative;
  overflow: hidden;
}

.aurora {
  position: fixed;
  inset: -30%;
  background: radial-gradient(circle at 20% 20%, rgba(224, 80, 53, 0.3), transparent 45%),
    radial-gradient(circle at 85% 35%, rgba(22, 130, 175, 0.25), transparent 40%),
    radial-gradient(circle at 50% 90%, rgba(57, 168, 112, 0.2), transparent 35%);
  filter: blur(35px);
  animation: drift 14s linear infinite alternate;
}

@keyframes drift {
  from {
    transform: translate3d(-2%, 0, 0) scale(1);
  }
  to {
    transform: translate3d(2%, -1%, 0) scale(1.05);
  }
}

.auth-shell {
  position: relative;
  z-index: 1;
  width: min(92vw, 440px);
}

.auth-card {
  background: var(--card);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 30px;
  box-shadow: var(--shadow);
}

.auth-card h1 {
  margin: 0;
  font-size: 2rem;
}

.auth-card p {
  margin: 8px 0 24px;
  color: var(--ink-soft);
}

.auth-form {
  display: grid;
  gap: 12px;
  margin-bottom: 10px;
}

.auth-form label {
  font-size: 0.9rem;
  font-weight: 600;
}

.auth-form input {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
}

.field-hint {
  color: var(--ink-soft);
  font-size: 0.82rem;
  margin-top: -4px;
}

button {
  border: none;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font: inherit;
  font-weight: 700;
  padding: 12px 16px;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease;
}

button:hover {
  transform: translateY(-1px);
  background: var(--brand-dark);
}

button.secondary {
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  border: 1px solid var(--line);
}

button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.oauth-divider {
  display: grid;
  align-items: center;
  margin: 14px 0 10px;
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.oauth-divider::before {
  content: "";
  grid-area: 1 / 1;
  border-top: 1px solid var(--line);
}

.oauth-divider span {
  grid-area: 1 / 1;
  justify-self: center;
  padding: 0 10px;
  background: var(--card);
}

.google-login-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #ffffff;
  color: #1f1f1f;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.google-login-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(48, 58, 72, 0.18);
}

.error-banner {
  background: #ffebe7;
  border: 1px solid #f1c0b6;
  color: #7d2315;
  border-radius: 12px;
  padding: 10px;
  margin-bottom: 12px;
}

.dashboard-page {
  padding: 24px;
  position: relative;
}

.grid-background {
  position: fixed;
  inset: 0;
  background-image: linear-gradient(rgba(48, 58, 72, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(48, 58, 72, 0.05) 1px, transparent 1px);
  background-size: 26px 26px;
  pointer-events: none;
}

.topbar,
.dashboard-shell {
  position: relative;
  z-index: 1;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
}

.topbar-left {
  display: grid;
  gap: 10px;
}

.top-tabs {
  display: inline-flex;
  gap: 8px;
}

.tab-btn {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.tab-btn:hover {
  transform: translateY(-1px);
  color: var(--ink);
}

.tab-btn.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.topbar-right {
  display: flex;
  gap: 12px;
  align-items: center;
  color: var(--ink-soft);
}

.dashboard-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  max-width: 980px;
  margin: 0 auto;
}

.tab-panel[hidden] {
  display: none !important;
}

.event-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.history-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.history-panel h3 {
  margin: 0 0 10px;
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.history-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.7);
}

.history-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.history-decision {
  font-size: 0.74rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 3px 8px;
}

.history-decision-yes {
  background: rgba(46, 125, 50, 0.14);
  color: #1b5e20;
}

.history-decision-no {
  background: rgba(198, 40, 40, 0.14);
  color: #8e1e1e;
}

.history-time {
  color: var(--ink-soft);
  font-size: 0.82rem;
}

.history-title {
  margin: 6px 0 2px;
  color: var(--ink);
  font-weight: 600;
}

.history-meta {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.9rem;
}

.history-link {
  display: inline-block;
  margin-top: 6px;
  color: #0f6d96;
  font-size: 0.88rem;
}

.event-card {
  min-height: 360px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.95), rgba(245, 251, 255, 0.95));
}

.event-card h2 {
  margin: 0 0 10px;
}

.event-media {
  width: 100%;
  height: 190px;
  margin-bottom: 14px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(224, 80, 53, 0.2), rgba(22, 130, 175, 0.2));
}

.event-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.event-card p,
.event-card a {
  margin: 8px 0;
  color: var(--ink-soft);
}

#event-cost {
  color: var(--ink);
  font-weight: 600;
}

.event-card a {
  color: #0f6d96;
}

.decision-row {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

#decision-error {
  min-height: 1.2em;
  margin: 10px 2px 0;
  color: #b42318;
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .dashboard-page {
    padding: 14px;
  }

  .dashboard-shell {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .topbar-left {
    width: 100%;
  }

  .top-tabs {
    width: 100%;
  }

  .tab-btn {
    flex: 1 1 0;
    text-align: center;
  }

  .event-card {
    min-height: 320px;
  }
}
