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

:root {
  --bg: #f4f1eb;
  --card: #ffffff;
  --ink: #1c2b1f;
  --muted: #6b7a6e;
  --accent: #1a4731;
  --accent-hover: #143a27;
  --accent-light: #e8f3ec;
  --gold: #b8912a;
  --gold-light: #fdf6e3;
  --danger: #c0392b;
  --danger-light: #fdecea;
  --success: #1a5e37;
  --success-light: #e8f5ee;
  --border: #d6d0c4;
  --border-focus: #1a4731;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-sm: 0 2px 8px rgba(26, 40, 30, 0.07);
  --shadow-md: 0 8px 28px rgba(26, 40, 30, 0.10);
  --shadow-lg: 0 20px 50px rgba(26, 40, 30, 0.13);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 15px;
  color: var(--ink);
  background-color: var(--bg);
  background-image:
    radial-gradient(ellipse at 0% 0%, rgba(26, 71, 49, 0.06) 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, rgba(184, 145, 42, 0.05) 0%, transparent 50%);
  min-height: 100vh;
}

/* ── Header ─────────────────────────────────────── */
.site-header {
  background: var(--accent);
  background-image: linear-gradient(135deg, #1a4731 0%, #0f2e1e 100%);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.22);
}

.header-inner {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.header-logo {
  width: 44px;
  height: 44px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

.header-text h2 {
  margin: 0;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: #ffffff;
  line-height: 1.2;
}

.header-text span {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.60);
  letter-spacing: 0.02em;
}

.header-badge {
  margin-left: auto;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.20);
  color: rgba(255,255,255,0.85);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  padding: 4px 12px;
  border-radius: 20px;
}

/* ── Layout ──────────────────────────────────────── */
.container {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 24px 64px;
}

/* ── Cards ───────────────────────────────────────── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px 32px;
  margin-bottom: 20px;
}

.card.hero-card {
  background: linear-gradient(135deg, #1a4731 0%, #0f2e1e 100%);
  border-color: transparent;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.card.hero-card::before {
  content: '';
}

.card.hero-card h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.7rem;
  margin: 0 0 8px;
  color: #fff;
  line-height: 1.25;
}

.card.hero-card .subtitle {
  color: rgba(255,255,255,0.70);
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.55;
  max-width: 520px;
}

/* Section card */
.card.section-card {
  padding-top: 24px;
}

.card.section-card h3 {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: var(--accent-light);
  color: var(--accent);
  border: 1px solid rgba(26, 71, 49, 0.15);
  border-radius: 99px;
  padding: 6px 16px 6px 11px;
  font-family: 'Inter', 'Segoe UI', sans-serif;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  margin: 0 0 22px;
}

.card.section-card h3::before {
  content: '';
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.75;
}

/* ── Progress bar ────────────────────────────────── */
.progress-wrap {
  margin-bottom: 24px;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 6px;
}

.progress-track {
  height: 5px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: 99px;
  transition: width 0.5s ease;
}

/* ── Typography ──────────────────────────────────── */
h1, h2, h3, h4 {
  margin-top: 0;
  line-height: 1.3;
}

.subtitle {
  color: var(--muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Fields ──────────────────────────────────────── */
.field {
  margin-bottom: 22px;
}

.field:last-child {
  margin-bottom: 0;
}

label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.4;
}

.required::after {
  content: " *";
  color: var(--danger);
}

/* Text inputs */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
  appearance: none;
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(26, 71, 49, 0.12);
}

textarea {
  min-height: 110px;
  resize: vertical;
  line-height: 1.6;
}

/* ── Rating buttons (1-5) ────────────────────────── */
.rating-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rating-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 52px;
  padding: 10px 8px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  user-select: none;
}

.rating-btn input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.rating-btn .rating-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--muted);
  line-height: 1;
  transition: color 0.18s;
}

.rating-btn .rating-label {
  font-size: 0.6rem;
  color: var(--muted);
  font-weight: 500;
  letter-spacing: 0.03em;
  text-align: center;
  line-height: 1.1;
  transition: color 0.18s;
}

.rating-btn:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.rating-btn:hover .rating-num,
.rating-btn:hover .rating-label {
  color: var(--accent);
}

.rating-btn.selected {
  border-color: var(--accent);
  background: var(--accent);
}

.rating-btn.selected .rating-num,
.rating-btn.selected .rating-label {
  color: #fff;
}

.rating-btn.selected-gold {
  border-color: var(--gold);
  background: var(--gold);
}

.rating-btn.selected-gold .rating-num,
.rating-btn.selected-gold .rating-label {
  color: #fff;
}

/* ── Radio group ─────────────────────────────────── */
.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  font-weight: 500;
  font-size: 0.9rem;
}

.radio-item input[type="radio"] {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.radio-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.radio-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Checkbox group ──────────────────────────────── */
.checkbox-group {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 11px 14px;
  background: #fff;
  cursor: pointer;
  transition: all 0.18s ease;
  user-select: none;
  font-size: 0.9rem;
  font-weight: 500;
}

.checkbox-item input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}

.checkbox-item:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.checkbox-item:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

/* ── Buttons ─────────────────────────────────────── */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
  align-items: center;
}

button {
  border: none;
  border-radius: var(--radius-sm);
  padding: 12px 24px;
  font-size: 0.9375rem;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.01em;
}

button.primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 3px 12px rgba(26, 71, 49, 0.28);
}

button.primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 5px 18px rgba(26, 71, 49, 0.35);
  transform: translateY(-1px);
}

button.primary:active {
  transform: translateY(0);
}

button.secondary {
  background: transparent;
  color: var(--muted);
  border: 1.5px solid var(--border);
}

button.secondary:hover {
  border-color: #aaa;
  color: var(--ink);
  background: #f5f5f3;
}

button.danger {
  background: var(--danger);
  color: #fff;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ── Alerts ──────────────────────────────────────── */
.alert {
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  margin-top: 16px;
  font-size: 0.9rem;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.alert::before {
  flex-shrink: 0;
  font-size: 1rem;
  margin-top: 1px;
}

.alert.ok {
  background: var(--success-light);
  color: var(--success);
  border: 1px solid rgba(26, 94, 55, 0.2);
}

.alert.ok::before {
  content: '';
}

.alert.err {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid rgba(192, 57, 43, 0.2);
}

.alert.err::before {
  content: '!';
  font-weight: 700;
}

/* ── Registrant field ────────────────────────────── */
.registrant-field {
  background: var(--gold-light);
  border: 1.5px solid rgba(184, 145, 42, 0.30);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  margin-bottom: 22px;
}

.registrant-field label {
  color: #7a5c0e;
}

.registrant-field input {
  border-color: rgba(184, 145, 42, 0.35);
  background: #fffef8;
}

.registrant-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 145, 42, 0.15);
}

/* ── Table (panel de respuestas) ─────────────────── */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

th {
  background: var(--accent);
  color: rgba(255,255,255,0.9);
  text-align: left;
  padding: 12px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

th:first-child { border-radius: var(--radius-sm) 0 0 0; }
th:last-child { border-radius: 0 var(--radius-sm) 0 0; }

td {
  padding: 11px 14px;
  border-bottom: 1px solid #eee;
  vertical-align: top;
  color: var(--ink);
}

tr:last-child td {
  border-bottom: none;
}

tr:nth-child(even) td {
  background: #fafaf8;
}

tr:hover td {
  background: var(--accent-light);
}

/* Serial badge */
.badge-serial {
  display: inline-block;
  background: var(--accent-light);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 2px 8px;
  border-radius: 4px;
}

/* ── Admin token field ───────────────────────────── */
.admin-token-wrap {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}

.admin-token-wrap .field {
  flex: 1;
  margin: 0;
}

/* ── Stats row ───────────────────────────────────── */
.stats-row {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.stat-chip {
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ── Divider ─────────────────────────────────────── */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

/* ── Submit success state ────────────────────────── */
.success-banner {
  text-align: center;
  padding: 32px 24px;
}

.success-banner .success-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

.success-banner h2 {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--accent);
  margin-bottom: 8px;
}

.success-banner p {
  color: var(--muted);
  margin-bottom: 20px;
}

.folio-chip {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  padding: 8px 20px;
  border-radius: 8px;
  letter-spacing: 0.06em;
}

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 768px) {
  .container {
    padding: 20px 16px 48px;
  }

  .card {
    padding: 20px 18px;
    border-radius: var(--radius-md);
  }

  .card.hero-card h1 {
    font-size: 1.35rem;
  }

  button {
    width: 100%;
    text-align: center;
    justify-content: center;
  }

  .actions {
    flex-direction: column;
  }

  .rating-group {
    gap: 6px;
  }

  .rating-btn {
    min-width: 44px;
    padding: 8px 6px 6px;
  }

  .admin-token-wrap {
    flex-direction: column;
  }

  .header-badge {
    display: none;
  }
}
