/* ============================================================
   404 Day Excuse Generator - Styles
   Mobile-first. Dark theme with 404 Day gold accents.
   ============================================================ */

/* --- Reset & Base --- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0a0a0a;
  --bg-card: rgba(255, 255, 255, 0.05);
  --bg-card-hover: rgba(255, 255, 255, 0.08);
  --gold: #c9a84c;
  --gold-dim: rgba(201, 168, 76, 0.2);
  --green: #1b3a2d;
  --green-light: #2a5a43;
  --white: #ffffff;
  --white-dim: rgba(255, 255, 255, 0.6);
  --white-muted: rgba(255, 255, 255, 0.35);
  --red: #cc3333;
  --text: #f0f0f0;
  --text-secondary: #999999;
  --border: rgba(255, 255, 255, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  overflow-x: hidden;
}

#app {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Views --- */
.view {
  display: none;
  padding-bottom: 60px;
}
.view.active {
  display: block;
  animation: fadeIn 0.3s var(--ease);
}

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

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 24px;
  border: none;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s var(--ease);
  text-decoration: none;
  gap: 8px;
}

.btn-primary {
  background: var(--gold);
  color: #000;
  width: 100%;
}
.btn-primary:hover {
  background: #d4b45a;
  transform: translateY(-1px);
}
.btn-primary:active {
  transform: translateY(0);
}
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  width: 100%;
}
.btn-secondary:hover {
  background: var(--bg-card-hover);
}

.btn-gold {
  background: var(--gold-dim);
  color: var(--gold);
  width: 100%;
}
.btn-gold:hover {
  background: rgba(201, 168, 76, 0.3);
}

.btn-cta {
  font-size: 18px;
  padding: 16px 32px;
  letter-spacing: 0.02em;
}

.btn-back {
  background: none;
  border: none;
  color: var(--white-dim);
  font-family: var(--font);
  font-size: 16px;
  cursor: pointer;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 4px;
}
.btn-back:hover {
  color: var(--white);
}
.btn-back-arrow {
  font-size: 24px;
  line-height: 1;
}

/* ============================================================
   LANDING
   ============================================================ */

.landing-header {
  text-align: center;
  padding: 40px 0 20px;
}
.landing-logo {
  height: 80px;
  width: auto;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 16px 0 24px;
}
.countdown-group {
  text-align: center;
}
.countdown-value {
  display: block;
  font-size: 32px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.countdown-label {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-top: 4px;
}
.countdown-sep {
  font-size: 24px;
  color: var(--white-muted);
  font-weight: 700;
  padding-bottom: 14px;
}

/* Hero */
.landing-hero {
  text-align: center;
  padding: 20px 0 40px;
}
.landing-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 16px;
}
.landing-subtitle {
  font-size: 16px;
  color: var(--white-dim);
  margin-bottom: 28px;
  line-height: 1.6;
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 40px 0 20px;
  color: var(--text-secondary);
  font-size: 14px;
}
.footer-partners {
  height: 40px;
  margin-top: 16px;
  opacity: 0.7;
}

/* ============================================================
   SCHEDULE
   ============================================================ */

.schedule-section {
  padding: 32px 0;
}

.schedule-heading {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

.schedule-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
}

.schedule-tag {
  display: inline-block;
  background: var(--gold-dim);
  color: var(--gold);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.schedule-event-name {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 6px;
}

.schedule-event-meta {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.schedule-event-desc {
  font-size: 14px;
  color: var(--white-dim);
  margin-bottom: 12px;
  line-height: 1.5;
}

.btn-rsvp {
  display: inline-block;
  background: var(--gold);
  color: #000;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 8px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.2s;
}
.btn-rsvp:hover {
  background: #d4b45a;
}

/* ============================================================
   FORM
   ============================================================ */

.form-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.form-subtitle {
  font-size: 15px;
  color: var(--white-dim);
  margin-bottom: 24px;
  line-height: 1.5;
}

/* Note Type Cards */
.note-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}

.note-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 20px 12px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s var(--ease);
  font-family: var(--font);
  color: var(--text);
}
.note-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 255, 255, 0.2);
}
.note-card.selected {
  border-color: var(--gold);
  background: rgba(201, 168, 76, 0.08);
  box-shadow: 0 0 0 1px var(--gold);
}

.note-card-icon {
  font-size: 32px;
  margin-bottom: 8px;
}
.note-card-label {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 4px;
}
.note-card-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Form Fields */
.form-fields {
  opacity: 0;
  max-height: 0;
  overflow: hidden;
  transition:
    opacity 0.3s var(--ease),
    max-height 0.4s var(--ease);
}
.form-fields.visible {
  opacity: 1;
  max-height: 800px;
}

.field-group {
  margin-bottom: 16px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--white-dim);
}
.field-hint {
  font-weight: 400;
  color: var(--text-secondary);
}

.field-input {
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  transition: border-color 0.2s;
  outline: none;
}
.field-input:focus {
  border-color: var(--gold);
}
.field-input::placeholder {
  color: var(--white-muted);
}

/* Variant Picker */
.variant-picker {
  margin-bottom: 20px;
}

.variant-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.variant-btn {
  padding: 8px 16px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.variant-btn:hover {
  border-color: rgba(255, 255, 255, 0.25);
}
.variant-btn.selected {
  background: var(--gold-dim);
  border-color: var(--gold);
  color: var(--gold);
}

/* Error Message */
.form-error {
  background: rgba(204, 51, 51, 0.15);
  border: 1px solid rgba(204, 51, 51, 0.3);
  color: #ff6b6b;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.form-error.visible {
  opacity: 1;
}

.btn-generate {
  margin-top: 8px;
}

/* ============================================================
   RESULT
   ============================================================ */

.result-header {
  text-align: center;
  padding: 24px 0 16px;
}
.result-title {
  font-size: 24px;
  font-weight: 700;
  margin-bottom: 8px;
}
.result-subtitle {
  font-size: 15px;
  color: var(--white-dim);
  line-height: 1.5;
}

/* Preview Container */
.preview-container {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 0 auto 24px;
  min-height: 300px;
}

.preview-image {
  border-radius: var(--radius);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

/* Stamp Overlay Animation */
.stamp-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(-12deg) scale(0);
  opacity: 0;
  pointer-events: none;
  z-index: 10;
}

.stamp-overlay.animate {
  animation: stampIn 0.6s var(--ease) forwards;
}

@keyframes stampIn {
  0% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(3);
    opacity: 0;
  }
  50% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(0.9);
    opacity: 1;
  }
  70% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(1.05);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, -50%) rotate(-12deg) scale(1);
    opacity: 0;
  }
}

.stamp-text {
  display: block;
  font-size: 48px;
  font-weight: 900;
  color: var(--red);
  border: 4px solid var(--red);
  padding: 8px 24px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.85;
}

/* Actions */
.result-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

/* Caption Box */
.caption-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 32px;
}

.caption-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.caption-text {
  font-size: 14px;
  color: var(--white-dim);
  line-height: 1.6;
  margin-bottom: 12px;
  white-space: pre-line;
}

.btn-copy {
  font-size: 14px;
  padding: 10px 16px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (min-width: 520px) {
  #app {
    max-width: 520px;
    padding: 0 32px;
  }
  .landing-title {
    font-size: 36px;
  }
  .countdown-value {
    font-size: 40px;
  }
}

@media (min-width: 768px) {
  #app {
    max-width: 600px;
  }
  .landing-title {
    font-size: 42px;
  }
}
