:root {
  --bg:            #050b18;
  --surface:       #0c1526;
  --surface-alt:   #0f1c30;
  --border:        #1a2d4e;

  --neon:          #00d2ff;
  --neon-soft:     rgba(0, 210, 255, 0.1);
  --neon-glow:     0 0 22px rgba(0, 210, 255, 0.22);
  --purple:        #7b61ff;
  --purple-soft:   rgba(123, 97, 255, 0.1);
  --teal:          #00e5a0;

  --text:          #f0f7ff;
  --text-muted:    #c8e2ff;
  --text-dim:      #5e7099;
  --glow-text:     0 0 10px rgba(140, 200, 255, 0.45);

  --radius:        10px;
  --heading:       'Montserrat', sans-serif;
  --sans:          'Inter', sans-serif;
  --display:       'Orbitron', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background-color: var(--bg);
  background-image:
    linear-gradient(rgba(0, 210, 255, 0.022) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 210, 255, 0.022) 1px, transparent 1px);
  background-size: 48px 48px;
  line-height: 1.6;
  min-height: 100vh;
}

.page {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px 80px;
}

/* ── Masthead ── */
.masthead {
  text-align: center;
  padding: 64px 20px 36px;
}

.masthead-kicker {
  font-family: var(--heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.38em;
  text-transform: uppercase;
  color: var(--neon);
  margin: 0 0 18px;
  opacity: 0.75;
}

.masthead-title {
  font-family: 'Cinzel', serif;
  font-size: 3.6rem;
  font-weight: 700;
  letter-spacing: 0.22em;
  margin: 0;
  background: linear-gradient(130deg, #ffffff 0%, var(--neon) 50%, var(--purple) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 28px rgba(0, 210, 255, 0.35));
}

.masthead-rule {
  width: 140px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--neon), transparent);
  box-shadow: 0 0 10px var(--neon);
  margin: 26px auto 0;
  border: none;
}

/* ── Intro ── */
.intro {
  text-align: center;
  margin: 0 auto 50px;
  max-width: 660px;
}

.intro h2 {
  font-family: var(--heading);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.02em;
  text-shadow: var(--glow-text);
}

.intro p {
  color: var(--text-muted);
  font-size: 0.9rem;
  text-shadow: var(--glow-text);
}

.intro-note {
  font-size: 0.78rem;
  color: var(--text-dim);
}

/* ── Form sections ── */
.form-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 22px;
  overflow: hidden;
  transition: border-color 0.25s;
}

.form-section:hover {
  border-color: rgba(0, 210, 255, 0.18);
}

.section-header {
  display: flex;
  align-items: center;
  gap: 16px;
  background: linear-gradient(90deg,
    rgba(0, 210, 255, 0.07) 0%,
    rgba(123, 97, 255, 0.05) 100%);
  border-bottom: 1px solid var(--border);
  padding: 16px 22px;
}

.section-number {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--neon);
  background: var(--neon-soft);
  border: 1px solid rgba(0, 210, 255, 0.28);
  border-radius: 5px;
  padding: 5px 10px;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.section-header h3 {
  color: var(--text);
  margin: 0;
  font-family: var(--heading);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.section-desc {
  padding: 14px 22px 0;
  color: var(--text-muted);
  font-size: 0.86rem;
  margin: 0;
  text-shadow: var(--glow-text);
}

/* ── Field grids ── */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 18px 22px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field label {
  font-family: var(--heading);
  font-size: 0.66rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-muted);
}

.field input,
.field select,
.field textarea,
.subsection input,
.subsection select,
.subsection textarea,
.assignment-row select {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: rgba(5, 11, 24, 0.65);
  color: var(--text);
  width: 100%;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}

.field select,
.assignment-row select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='11' height='7' viewBox='0 0 11 7'%3E%3Cpath d='M1 1l4.5 4.5L10 1' stroke='%235e7099' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 36px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.subsection input:focus,
.subsection select:focus,
.assignment-row select:focus {
  outline: none;
  border-color: var(--neon);
  box-shadow: 0 0 0 3px var(--neon-soft), 0 0 18px rgba(0, 210, 255, 0.1);
}

.field input::placeholder { color: var(--text-dim); }
.field textarea { resize: vertical; min-height: 120px; }

/* ── Subsections ── */
.subsection {
  padding: 4px 22px 22px;
}

.subsection h4 {
  font-family: var(--heading);
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--neon);
  opacity: 0.75;
  margin: 20px 0 10px;
}

/* ── Radios & checkboxes ── */
.radio-list,
.checkbox-grid {
  display: grid;
  gap: 10px;
  padding: 16px 22px;
}

.checkbox-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.subsection .checkbox-grid,
.subsection .radio-list {
  padding: 0 0 4px;
}

.radio-item,
.check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.875rem;
  cursor: pointer;
  color: var(--text-muted);
  text-shadow: var(--glow-text);
  transition: color 0.15s;
}

.radio-item:hover,
.check-item:hover {
  color: var(--text);
}

.check-item--locked {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.875rem;
  color: var(--teal);
  opacity: 0.65;
}

.radio-item input,
.check-item input {
  margin-top: 2px;
  accent-color: var(--neon);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

/* ── Theme grid ── */
.theme-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  padding: 18px 22px 22px;
}

.theme-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: rgba(5, 11, 24, 0.55);
  border: 1px solid rgba(0, 210, 255, 0.22);
  border-radius: 8px;
  padding: 7px;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.theme-card:hover {
  border-color: rgba(0, 210, 255, 0.5);
  box-shadow: 0 0 12px rgba(0, 210, 255, 0.1);
}

.theme-card--image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 4px;
  filter: brightness(0.88) saturate(0.9);
  transition: filter 0.2s;
}

.theme-card:hover .theme-card--image img,
.theme-card.is-selected img {
  filter: brightness(1) saturate(1);
}

.theme-card input[type="radio"] {
  position: absolute;
  top: 13px;
  right: 13px;
  width: 16px;
  height: 16px;
  accent-color: var(--neon);
  z-index: 1;
}

.theme-card.is-selected {
  border-color: var(--neon);
  box-shadow: 0 0 0 1px var(--neon), 0 0 18px rgba(0, 210, 255, 0.25);
}

.theme-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 5px 4px 3px;
}

.theme-name {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
  text-shadow: var(--glow-text);
}

/* ── Fondo de carta gallery (section 04) ── */
.fondo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 0 6px;
}

.fondo-grid .theme-card--image img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
  border-radius: 4px;
}

@media (max-width: 640px) {
  .fondo-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ── Emplatado gallery (section 05) ── */
.emplatado-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  padding: 10px 22px 22px;
}

.emplatado-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 5px;
  border: 1px solid rgba(0, 210, 255, 0.22);
  transition: border-color 0.18s;
}

.emplatado-item img:hover {
  border-color: rgba(0, 210, 255, 0.55);
}

@media (max-width: 640px) {
  .emplatado-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
}

/* ── Emplatado number badge ── */
.emplatado-item {
  position: relative;
}

.emplatado-num {
  position: absolute;
  bottom: 5px;
  left: 5px;
  font-family: var(--heading);
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--neon);
  background: rgba(5, 11, 24, 0.85);
  border: 1px solid rgba(0, 210, 255, 0.32);
  border-radius: 3px;
  padding: 1px 5px;
  line-height: 1.6;
  pointer-events: none;
}

/* ── Dish form ── */
.dish-form {
  border: 1px solid rgba(0, 210, 255, 0.18);
  border-radius: 8px;
  background: rgba(5, 11, 24, 0.5);
  overflow: hidden;
  margin-top: 16px;
}

.dish-form-header {
  display: flex;
  align-items: center;
  padding: 11px 16px;
  background: linear-gradient(90deg, rgba(0,210,255,0.07), rgba(123,97,255,0.05));
  border-bottom: 1px solid rgba(0,210,255,0.13);
  font-family: var(--heading);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--neon);
}

.dish-form-body {
  padding: 16px;
}

.dish-form-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.dish-video-toggle {
  display: flex;
  gap: 20px;
  padding: 4px 0;
}

.dish-video-toggle .radio-item {
  align-items: center;
}

.dish-video-toggle .radio-item input {
  margin-top: 0;
}

.btn-add-dish {
  font-family: var(--heading);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  background: linear-gradient(135deg, var(--neon), var(--purple));
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 22px;
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.15s;
}

.btn-add-dish:hover {
  box-shadow: 0 0 20px rgba(0, 210, 255, 0.3);
  transform: translateY(-1px);
}

.btn-cancel-dish {
  font-family: var(--heading);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 18px;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.btn-cancel-dish:hover {
  color: var(--text-muted);
  border-color: rgba(0,210,255,0.25);
}

/* ── Dish cards ── */
.dish-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.dish-card {
  background: rgba(12, 21, 38, 0.7);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 12px 14px;
  transition: border-color 0.18s;
}

.dish-card:hover {
  border-color: rgba(0, 210, 255, 0.2);
}

.dish-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.dish-card-num {
  font-family: var(--heading);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--neon);
  opacity: 0.65;
  letter-spacing: 0.08em;
  flex-shrink: 0;
}

.dish-card-name {
  font-family: var(--heading);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text);
  text-shadow: var(--glow-text);
  flex: 1;
  min-width: 0;
}

.dish-card-cat {
  font-family: var(--heading);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--purple);
  background: var(--purple-soft);
  border: 1px solid rgba(123, 97, 255, 0.22);
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
}

.dish-card-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.dish-btn-edit,
.dish-btn-del {
  font-family: var(--heading);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 3px 10px;
  cursor: pointer;
  border: 1px solid;
  transition: all 0.15s;
  background: transparent;
}

.dish-btn-edit {
  color: var(--neon);
  border-color: rgba(0, 210, 255, 0.28);
}

.dish-btn-edit:hover {
  background: var(--neon-soft);
}

.dish-btn-del {
  color: #ff6b8a;
  border-color: rgba(255, 107, 138, 0.28);
}

.dish-btn-del:hover {
  background: rgba(255, 107, 138, 0.08);
}

.dish-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 7px 0 0;
  line-height: 1.5;
  text-shadow: var(--glow-text);
}

.dish-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.dish-card-emplatado,
.dish-card-video {
  display: inline-block;
  font-family: var(--heading);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border-radius: 4px;
  padding: 2px 8px;
}

.dish-card-emplatado {
  color: var(--teal);
  border: 1px solid rgba(0, 229, 160, 0.25);
}

.dish-card-video {
  color: var(--purple);
  border: 1px solid rgba(123, 97, 255, 0.25);
  text-transform: none;
  letter-spacing: 0.04em;
}

/* ── Surfaces ── */
.surface-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 9px;
  padding: 16px 22px;
}

.surface-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  cursor: pointer;
  background: rgba(5, 11, 24, 0.45);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 9px 12px;
  color: var(--text-muted);
  text-shadow: var(--glow-text);
  transition: border-color 0.18s, color 0.18s;
}

.surface-item:hover {
  border-color: rgba(0, 210, 255, 0.22);
  color: var(--text);
}

.surface-item input {
  accent-color: var(--neon);
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.surface-swatch {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.07);
}

/* ── Assignment table ── */
.assignment-table {
  display: grid;
  gap: 8px;
  padding: 0 0 16px;
}

.assignment-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  align-items: center;
}

.assignment-row--head span {
  font-family: var(--heading);
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--text-dim);
}

.assignment-row span:first-child {
  font-size: 0.875rem;
  color: var(--text-muted);
  text-shadow: var(--glow-text);
}

/* ── Submit ── */
.submit-row {
  text-align: center;
  padding: 24px 0 50px;
}

#submit-btn {
  font-family: var(--heading);
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-size: 0.82rem;
  background: linear-gradient(135deg, var(--neon) 0%, var(--purple) 100%);
  color: #fff;
  border: none;
  padding: 16px 52px;
  border-radius: 6px;
  cursor: pointer;
  box-shadow: 0 0 32px rgba(0, 210, 255, 0.22), 0 4px 20px rgba(0, 0, 0, 0.45);
  transition: box-shadow 0.22s, transform 0.16s;
  position: relative;
  overflow: hidden;
}

#submit-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent 60%);
  pointer-events: none;
}

#submit-btn:hover {
  box-shadow: 0 0 55px rgba(0, 210, 255, 0.38), 0 6px 28px rgba(0, 0, 0, 0.55);
  transform: translateY(-2px);
}

#submit-btn:disabled {
  opacity: 0.5;
  cursor: wait;
  transform: none;
}

.form-error {
  color: #ff6b8a;
  margin-top: 14px;
  font-size: 0.875rem;
}

.hidden { display: none !important; }

/* ── Thank you ── */
.thank-you {
  text-align: center;
  padding: 80px 20px;
}

.thank-you h2 {
  font-family: var(--display);
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  color: var(--neon);
  filter: drop-shadow(0 0 24px rgba(0, 210, 255, 0.4));
}

.thank-you-sub {
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-top: 20px;
}

.thank-you a {
  color: var(--neon);
  text-decoration: none;
}

.thank-you a:hover { text-decoration: underline; }

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 20px;
  color: var(--text-dim);
  font-family: var(--heading);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
}

/* ── Responsive ── */
@media (max-width: 640px) {
  .field-grid,
  .assignment-row,
  .checkbox-grid,
  .surface-grid {
    grid-template-columns: 1fr;
  }

  .theme-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .masthead-title {
    font-size: 2.4rem;
  }
}
