@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* =========================================================
   CSS VARIABLES
   ========================================================= */
:root {
  --bg: #111827;
  --bg-surface: #1f2937;
  --bg-elevated: #374151;
  --border: #374151;
  --border-subtle: #2d3748;

  --primary: #f59e0b;
  --primary-hover: #d97706;
  --primary-light: #fef3c7;

  --text: #f9fafb;
  --text-muted: #9ca3af;
  --text-subtle: #6b7280;

  --danger: #ef4444;
  --success: #10b981;
  --info: #6366f1;

  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  --shadow: 0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -2px rgba(0,0,0,0.4);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.5), 0 8px 10px -6px rgba(0,0,0,0.4);

  --nav-height: 64px;
  --font: 'Inter', system-ui, sans-serif;

  /* Cork board */
  --cork: #c8a86b;
  --cork-dark: #b8985b;

  /* Post-it colors */
  --postit-yellow: #fef08a;
  --postit-pink: #fbcfe8;
  --postit-blue: #bae6fd;
  --postit-green: #bbf7d0;
}

/* =========================================================
   RESET & BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

ul { list-style: none; }

/* =========================================================
   NAVIGATION
   ========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-height);
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  height: 100%;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.nav-logo:hover { text-decoration: none; opacity: 0.85; }
.nav-logo-img { height: 44px; width: auto; display: block; }

.nav-links {
  display: flex;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius);
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s, background 0.2s;
  text-decoration: none;
}

.nav-link:hover { color: var(--text); background: var(--bg-surface); text-decoration: none; }

.nav-link--highlight {
  color: var(--primary);
  border: 1px solid var(--primary);
}

.nav-link--highlight:hover {
  background: var(--primary);
  color: var(--bg);
}

.nav-auth { display: flex; gap: 0.5rem; align-items: center; }

.nav-btn {
  padding: 0.4rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  background: var(--primary);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  text-decoration: none;
  display: inline-block;
}

.nav-btn:hover { background: var(--primary-hover); text-decoration: none; color: var(--bg); }

.nav-btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.nav-btn--ghost:hover { background: var(--bg-surface); color: var(--text); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: 0.2s;
}

.inline-form { display: inline; }
.inline-form button { font-family: var(--font); }

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content {
  flex: 1;
  margin-top: var(--nav-height);
}

/* =========================================================
   BUTTONS
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: background 0.2s, color 0.2s, transform 0.1s, box-shadow 0.2s;
  text-decoration: none;
  line-height: 1;
}

.btn:active { transform: scale(0.97); }
.btn:hover { text-decoration: none; }

.btn--primary {
  background: var(--primary);
  color: #000;
}
.btn--primary:hover { background: var(--primary-hover); color: #000; }

.btn--ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn--ghost:hover { background: var(--bg-surface); color: var(--text); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #dc2626; }

.btn--lg { padding: 0.85rem 2rem; font-size: 1rem; border-radius: var(--radius-lg); }
.btn--sm { padding: 0.35rem 0.85rem; font-size: 0.8rem; }
.btn--full { width: 100%; }

/* =========================================================
   MESSAGES
   ========================================================= */
.messages-container {
  position: fixed;
  top: calc(var(--nav-height) + 1rem);
  right: 1rem;
  z-index: 900;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-width: 380px;
}

.message {
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
}

.message--success { border-left: 3px solid var(--success); }
.message--error, .message--warning { border-left: 3px solid var(--danger); }
.message--info { border-left: 3px solid var(--info); }

.message-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 0;
  margin-left: auto;
  line-height: 1;
}

.message-close:hover { color: var(--text); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  min-height: 90vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 6rem 1.5rem;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(10,10,15,0.88) 0%, rgba(15,15,25,0.78) 60%, rgba(10,10,15,0.85) 100%);
  z-index: 0;
}

.hero-bg {
  display: none;
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.hero-logo {
  width: 280px;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
}

.hero-eyebrow {
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 1rem;
}

.hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin-bottom: 1.5rem;
  letter-spacing: -0.02em;
}

.hero-title-accent { color: var(--primary); }

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.hero-count {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.hero-count-num {
  font-weight: 700;
  color: var(--primary);
  font-size: 1.1rem;
}

.hero-decoration {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.hero-circle {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(245,158,11,0.1);
}

.hero-circle--1 {
  width: 600px; height: 600px;
  top: -200px; right: -200px;
}

.hero-circle--2 {
  width: 300px; height: 300px;
  bottom: -100px; left: 5%;
}

/* =========================================================
   SECTIONS
   ========================================================= */
.section { padding: 5rem 1.5rem; }
.section--dark { background: var(--bg-surface); }

.container { max-width: 1180px; margin: 0 auto; }

.section-header {
  text-align: center;
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.section-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.01em;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 540px;
  line-height: 1.7;
}

.section-link {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 600;
}

/* =========================================================
   FEATURES GRID
   ========================================================= */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}

.feature-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.feature-icon { font-size: 2rem; margin-bottom: 1rem; }
.feature-title { font-size: 1.1rem; font-weight: 700; margin-bottom: 0.5rem; }
.feature-text { color: var(--text-muted); font-size: 0.9rem; line-height: 1.6; }

/* =========================================================
   EVENTS
   ========================================================= */
.events-list { display: flex; flex-direction: column; gap: 1rem; max-width: 800px; margin: 0 auto; }

.event-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  transition: border-color 0.2s;
}

.event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 52px;
}

.event-day {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}

.event-month {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.event-info { flex: 1; }

.event-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  margin-bottom: 0.4rem;
  background: var(--bg-surface);
  color: var(--text-muted);
}

.event-type--meeting { background: rgba(99,102,241,0.15); color: #818cf8; }
.event-type--concert { background: rgba(245,158,11,0.15); color: #fbbf24; }
.event-type--workshop { background: rgba(16,185,129,0.15); color: #34d399; }

.event-title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.25rem; }
.event-time { font-size: 0.85rem; color: var(--text-muted); }
.event-desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.4rem; line-height: 1.5; }

/* =========================================================
   CTA SECTION
   ========================================================= */
.cta-section { text-align: center; }

.cta-box {
  background: linear-gradient(135deg, var(--bg-surface), #1a2535);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  max-width: 700px;
  margin: 0 auto;
}

.cta-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.cta-text {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 2.5rem;
  line-height: 1.7;
}

/* =========================================================
   PAGE CONTAINER (inner pages)
   ========================================================= */
.page-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.page-title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* =========================================================
   FORMS
   ========================================================= */
.form-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 640px;
}

.form-card--wide { max-width: 860px; }

.form-intro {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  line-height: 1.6;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.form-group { margin-bottom: 1.25rem; }

.form-label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  letter-spacing: 0.01em;
}

.required { color: var(--primary); }

.form-input,
input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
textarea,
select {
  width: 100%;
  padding: 0.65rem 0.9rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color 0.2s, box-shadow 0.2s;
  appearance: none;
  -webkit-appearance: none;
}

.form-input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="datetime-local"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,0.15);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.5rem;
  cursor: pointer;
}

textarea { resize: vertical; min-height: 100px; }

.form-group--checkbox { margin-bottom: 1rem; }

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  min-width: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

.checkbox-text { font-size: 0.9rem; }

.field-errors {
  margin-top: 0.35rem;
  list-style: none;
}

.field-errors li {
  font-size: 0.8rem;
  color: #f87171;
}

.form-error-banner {
  background: rgba(239,68,68,0.1);
  border: 1px solid rgba(239,68,68,0.3);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-bottom: 1.5rem;
  color: #fca5a5;
  font-size: 0.9rem;
}

.form-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

.form-privacy {
  margin-top: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-subtle);
  text-align: center;
  border-top: 1px solid var(--border-subtle);
  padding-top: 1rem;
}

.form-fieldset {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-legend {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  padding: 0 0.5rem;
}

/* =========================================================
   AUTH PAGES
   ========================================================= */
.auth-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.auth-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
}

.auth-header { margin-bottom: 2rem; text-align: center; }
.auth-title { font-size: 1.75rem; font-weight: 800; margin-bottom: 0.5rem; }
.auth-subtitle { color: var(--text-muted); font-size: 0.95rem; }

.auth-form .form-group { margin-bottom: 1.25rem; }

/* =========================================================
   BOARD PAGE
   ========================================================= */
.board-page { min-height: calc(100vh - var(--nav-height)); }

.board-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 2rem 1.5rem 1.5rem;
}

.board-header-inner { max-width: 1280px; margin: 0 auto; }

.board-nav-links {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.board-nav-link {
  padding: 0.35rem 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-muted);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: all 0.2s;
}

.board-nav-link:hover { color: var(--text); border-color: var(--text-muted); text-decoration: none; }
.board-nav-link--active { color: var(--primary); border-color: var(--primary); background: rgba(245,158,11,0.08); }

.board-title { font-size: 2rem; font-weight: 800; }
.board-desc { color: var(--text-muted); margin-top: 0.25rem; }

/* Add post-it panel */
.add-postit-panel {
  background: var(--bg);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1.5rem;
}

.add-postit-inner { max-width: 1280px; margin: 0 auto; }
.add-postit-title { font-size: 1rem; font-weight: 700; margin-bottom: 1rem; color: var(--text-muted); }

.add-postit-form { display: flex; flex-direction: column; gap: 1rem; }

.add-postit-fields {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.add-postit-content { flex: 1; min-width: 280px; margin-bottom: 0; }
.add-postit-color { margin-bottom: 0; }

.postit-textarea {
  min-height: 80px;
  resize: vertical;
}

/* Color picker */
.color-picker { display: flex; gap: 0.6rem; align-items: center; padding: 0.4rem 0; }

.color-option { cursor: pointer; }
.color-option input { display: none; }

.color-swatch {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 3px solid transparent;
  transition: transform 0.15s, border-color 0.15s;
  cursor: pointer;
}

.color-option input:checked + .color-swatch {
  border-color: var(--text);
  transform: scale(1.15);
}

.color-swatch--yellow { background: var(--postit-yellow); }
.color-swatch--pink   { background: var(--postit-pink); }
.color-swatch--blue   { background: var(--postit-blue); }
.color-swatch--green  { background: var(--postit-green); }

.login-prompt {
  padding: 1rem 1.5rem;
  background: rgba(245,158,11,0.05);
  border-bottom: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* =========================================================
   CORK BOARD
   ========================================================= */
.corkboard {
  background-color: var(--cork);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4'%3E%3Crect width='4' height='4' fill='%23c8a86b'/%3E%3Ccircle cx='1' cy='1' r='0.5' fill='rgba(0,0,0,0.08)'/%3E%3Ccircle cx='3' cy='3' r='0.3' fill='rgba(0,0,0,0.06)'/%3E%3C/svg%3E");
  min-height: calc(100vh - 340px);
  padding: 2.5rem 1.5rem;
  box-shadow: inset 0 4px 20px rgba(0,0,0,0.3);
}

.corkboard-inner { max-width: 1280px; margin: 0 auto; }

.postits-container {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: flex-start;
}

.board-empty {
  width: 100%;
  text-align: center;
  padding: 4rem 1rem;
  color: rgba(0,0,0,0.4);
  font-size: 1.1rem;
  font-weight: 500;
}

/* =========================================================
   POST-ITS
   ========================================================= */
.postit {
  position: relative;
  width: 200px;
  min-height: 180px;
  padding: 1.25rem 1rem 1.5rem;
  border-radius: 2px;
  box-shadow:
    4px 4px 8px rgba(0,0,0,0.25),
    0 0 0 1px rgba(0,0,0,0.05);
  cursor: default;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  transition: transform 0.2s, box-shadow 0.2s;
  font-family: var(--font);
}

.postit:hover {
  box-shadow: 8px 8px 16px rgba(0,0,0,0.35), 0 0 0 1px rgba(0,0,0,0.08);
  transform: scale(1.03) !important;
  z-index: 10;
}

/* Post-it pin (decorative) */
.postit::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #ff6b6b, #c0392b);
  box-shadow: 0 2px 4px rgba(0,0,0,0.4);
  z-index: 1;
}

.postit--yellow { background: var(--postit-yellow); }
.postit--pink   { background: var(--postit-pink); }
.postit--blue   { background: var(--postit-blue); }
.postit--green  { background: var(--postit-green); }

.postit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.postit-author {
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(0,0,0,0.45);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: calc(100% - 28px);
}

.postit-delete {
  background: rgba(0,0,0,0.1);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  line-height: 1;
  cursor: pointer;
  color: rgba(0,0,0,0.5);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.15s, color 0.15s;
}

.postit-delete:hover { background: rgba(239,68,68,0.3); color: #991b1b; }

.postit-content {
  font-size: 0.9rem;
  color: rgba(0,0,0,0.8);
  line-height: 1.5;
  flex: 1;
  white-space: pre-wrap;
  word-break: break-word;
}

.postit-date {
  font-size: 0.7rem;
  color: rgba(0,0,0,0.35);
  margin-top: auto;
  text-align: right;
}

/* HTMX rotation utility classes */
.postit { transform: rotate(var(--rot, 0deg)); }

/* =========================================================
   CALENDAR
   ========================================================= */
.cal-legend {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
  padding: 0 1.5rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cal-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding: 0 1.5rem;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
}

.cal-month-title {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: var(--border-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 1100px;
  margin: 0 auto 2rem;
}

.cal-weekday {
  background: var(--bg-surface);
  padding: 0.6rem 0.5rem;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.cal-day {
  background: var(--bg-surface);
  min-height: 100px;
  padding: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: background 0.15s;
}

.cal-day:hover { background: var(--bg-elevated); }
.cal-day--empty { background: var(--bg); opacity: 0.3; }

.cal-day--today .cal-day-num {
  background: var(--primary);
  color: #000;
  border-radius: 50%;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.cal-day-num {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cal-events { display: flex; flex-direction: column; gap: 2px; }

.cal-event-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  color: #fff;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

.cal-event-badge:hover { opacity: 0.85; transform: scale(1.02); }

/* =========================================================
   MODAL
   ========================================================= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2rem;
  width: 100%;
  max-width: 500px;
  position: relative;
  box-shadow: var(--shadow-lg);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: var(--bg-elevated);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1.2rem;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.modal-close:hover { background: var(--danger); color: #fff; }

.modal-title {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 1rem;
  padding-right: 2rem;
}

.modal-time {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
}

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.75rem;
  line-height: 1.6;
}

.event-type-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 0.75rem;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
}

/* Alpine transitions */
[x-cloak] { display: none !important; }

/* =========================================================
   REGISTRO PAGE
   ========================================================= */
.registro-page { padding: 3rem 1.5rem 5rem; }

.registro-hero {
  text-align: center;
  max-width: 600px;
  margin: 0 auto 3rem;
}

.registro-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 800;
  margin-bottom: 1rem;
}

.registro-subtitle {
  font-size: 1.1rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.registro-form .form-card--wide { margin: 0 auto; }

/* =========================================================
   SUCCESS PAGE
   ========================================================= */
.success-page {
  min-height: calc(100vh - var(--nav-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
}

.success-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2rem;
  max-width: 560px;
  width: 100%;
  text-align: center;
}

.success-icon { font-size: 4rem; margin-bottom: 1.5rem; }
.success-title { font-size: 2rem; font-weight: 800; margin-bottom: 1rem; }
.success-text { color: var(--text-muted); margin-bottom: 0.75rem; font-size: 1rem; line-height: 1.6; }

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 2rem;
}

/* =========================================================
   SECCIÓN ¿TE SUMAS? — ACORDEÓN
   ========================================================= */
.section--unete {
  text-align: center;
}

.unete-cta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.registro-accordion {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  text-align: left;
  position: relative;
}

.registro-accordion-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  text-align: center;
}

.registro-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

.registro-submit {
  margin-top: 2rem;
}

.registro-close {
  display: block;
  margin: 1.5rem auto 0;
  background: none;
  border: none;
  color: var(--text-subtle);
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}
.registro-close:hover { color: var(--text-muted); }

.registro-messages {
  padding: 1rem;
  text-align: center;
}
.registro-message { font-size: 1rem; padding: 0.5rem; }
.registro-message--success { color: var(--success); }
.registro-message--error { color: var(--danger); }

/* Checkboxes */
.checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  cursor: pointer;
  padding: 0.6rem 0.75rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s, border-color 0.15s;
}
.checkbox-item:hover { background: var(--bg-elevated); border-color: var(--border); }

.checkbox-item input[type="checkbox"] { display: none; }

.checkbox-box {
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--border);
  border-radius: 4px;
  background: var(--bg);
  transition: background 0.15s, border-color 0.15s;
  position: relative;
}
.checkbox-item input:checked ~ .checkbox-box {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-item input:checked ~ .checkbox-box::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: 2px solid #111;
  border-top: none; border-left: none;
  transform: rotate(45deg);
}
.checkbox-label { font-size: 0.95rem; }
.checkbox-item input:checked ~ .checkbox-box + .checkbox-label { color: var(--primary); font-weight: 500; }

.required { color: var(--primary); font-size: 0.85rem; }
.optional { color: var(--text-subtle); font-size: 0.82rem; font-weight: 400; }

.form-group--conditional {
  border-left: 2px solid var(--primary);
  padding-left: 1rem;
  margin-left: 0.25rem;
}

/* Radio buttons (Sí / No) */
.radio-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  cursor: pointer;
  padding: 0.6rem 1.25rem;
  border-radius: var(--radius);
  border: 1px solid var(--border-subtle);
  transition: background 0.15s, border-color 0.15s;
  flex: 1;
  justify-content: center;
}
.radio-item:hover { background: var(--bg-elevated); border-color: var(--border); }
.radio-item--selected { border-color: var(--primary); background: rgba(245,158,11,0.08); }

.radio-item input[type="radio"] { display: none; }

.radio-box {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border);
  border-radius: 50%;
  background: var(--bg);
  transition: border-color 0.15s;
  position: relative;
}
.radio-item--selected .radio-box { border-color: var(--primary); }
.radio-item--selected .radio-box::after {
  content: '';
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary);
}
.radio-label { font-size: 0.95rem; font-weight: 500; }

/* Transición acordeón */
.accordion-enter { transition: opacity 0.3s ease, transform 0.3s ease; }
.accordion-enter-start { opacity: 0; transform: translateY(-8px); }
.accordion-enter-end { opacity: 1; transform: translateY(0); }

@media (max-width: 640px) {
  .registro-row { grid-template-columns: 1fr; }
  .registro-accordion { padding: 1.5rem 1rem; }
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  text-align: center;
}

.footer-text { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.25rem; }
.footer-sub { font-size: 0.8rem; color: var(--text-subtle); }
.footer-sub a { color: var(--primary); }

/* =========================================================
   ERROR MSG (HTMX)
   ========================================================= */
.error-msg {
  color: #f87171;
  font-size: 0.85rem;
  padding: 0.5rem;
  background: rgba(239,68,68,0.1);
  border-radius: var(--radius);
  margin: 0.5rem 0;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 768px) {
  .nav-links { display: none; flex-direction: column; }
  .nav--open .nav-links {
    display: flex;
    position: absolute;
    top: var(--nav-height);
    left: 0; right: 0;
    background: var(--bg-surface);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
  }
  .nav-toggle { display: flex; }
  .nav-auth { margin-left: auto; }

  .form-row { grid-template-columns: 1fr; }

  .add-postit-fields { flex-direction: column; }
  .add-postit-content { min-width: 100%; }

  .cal-grid { font-size: 0.8rem; }
  .cal-day { min-height: 60px; padding: 0.25rem; }
  .cal-event-badge { font-size: 0.6rem; }

  .hero-actions { flex-direction: column; align-items: center; }

  .features-grid { grid-template-columns: 1fr; }

  .postit { width: 160px; }
}

@media (max-width: 480px) {
  .hero { padding: 4rem 1rem; }
  .section { padding: 3rem 1rem; }
  .form-card { padding: 1.5rem 1rem; }
  .page-container { padding: 2rem 1rem 3rem; }
}
