:root {
  --bg: #f5f7f4;
  --surface: #ffffff;
  --surface-soft: #f0f2ef;
  --surface-strong: #e7ebe5;
  --border: rgba(18, 24, 20, 0.14);
  --text: #111512;
  --text-dim: #5f6861;
  --gold: #a3821f;
  --gold-2: #6f5615;
  --teal: #286d64;
  --teal-2: #dcefeb;
  --danger: #c23a3a;
  --danger-soft: #a93535;
  --radius: 8px;
  --shadow: 0 24px 70px rgba(20, 24, 20, 0.12);
  --field-bg: #fbfcfb;
  --placeholder: #8c948d;
}

:root[data-theme="dark"] {
  --bg: #080909;
  --surface: #121413;
  --surface-soft: #181b19;
  --surface-strong: #202520;
  --border: rgba(212, 175, 55, 0.2);
  --text: #f5f5f3;
  --text-dim: #a7aea7;
  --gold: #d4af37;
  --gold-2: #f0d486;
  --teal: #79c8bd;
  --teal-2: rgba(121, 200, 189, 0.13);
  --danger: #ef5350;
  --danger-soft: #f0a6a4;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.52);
  --field-bg: #101211;
  --placeholder: #717971;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background:
    linear-gradient(125deg, rgba(163, 130, 31, 0.1) 0%, transparent 32%),
    linear-gradient(315deg, rgba(40, 109, 100, 0.13) 0%, transparent 30%),
    repeating-linear-gradient(90deg, transparent 0 23px, rgba(127, 127, 127, 0.035) 23px 24px),
    var(--bg);
  color: var(--text);
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  padding: 32px 16px 48px;
  transition: background-color 0.2s, color 0.2s;
}

body::selection {
  background: rgba(212, 175, 55, 0.35);
}

.page-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 0.84fr) minmax(420px, 1fr);
  gap: 38px;
  align-items: stretch;
}

.theme-toggle {
  position: fixed;
  top: 18px;
  right: 18px;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  z-index: 50;
  transition: border-color 0.15s, transform 0.15s, background 0.15s;
  backdrop-filter: blur(14px);
}

.theme-toggle:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
}

.theme-toggle:focus-visible,
button.submit:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--gold) 35%, transparent);
  outline-offset: 3px;
}

.theme-toggle .icon {
  width: 19px;
  height: 19px;
}

.theme-toggle .icon-moon {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none;
}

:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block;
}

.event-panel {
  width: min(500px, 100%);
  justify-self: center;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  box-shadow: var(--shadow);
}

.event-art {
  width: 100%;
  height: 100%;
  min-height: 100%;
  background-image: url("../img/webinar.png");
  background-image:
    image-set(
      url("../img/webinar-bg.webp") type("image/webp"),
      url("../img/webinar.png") type("image/png")
    );
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
}

.brand-logo {
  width: min(210px, 62%);
  height: auto;
  margin-bottom: 16px;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.16));
}

/* El logo es blanco, pensado para fondo oscuro; se invierte en tema claro. */
:root:not([data-theme="dark"]) .brand-logo,
:root:not([data-theme="dark"]) .dash-logo {
  filter: invert(1) drop-shadow(0 12px 28px rgba(0, 0, 0, 0.12));
}

.eyebrow,
.section-label {
  display: block;
  color: var(--gold-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
}

h1 {
  margin-top: 10px;
  font-size: 28px;
  line-height: 1.14;
  font-weight: 800;
}

.event-copy {
  margin: 12px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.event-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.meta-item {
  min-height: 78px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--field-bg);
}

.meta-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--teal-2);
  color: var(--teal);
}

.meta-item small,
.meta-item strong {
  display: block;
}

.meta-item small {
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.2;
}

.meta-item strong {
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.icon {
  width: 16px;
  height: 16px;
  vertical-align: -2px;
  flex: 0 0 auto;
}

.registration-panel,
.feedback-panel {
  width: 100%;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.registration-panel {
  padding: 30px;
}

.form-heading {
  margin-bottom: 24px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

.form-heading p {
  margin: 8px 0 0;
  color: var(--text-dim);
  font-size: 14px;
  line-height: 1.5;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  row-gap: 18px;
}

.field {
  min-width: 0;
}

.field-wide {
  grid-column: 1 / -1;
}

label.q {
  display: block;
  min-height: 18px;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.3;
}

label.q .req {
  color: var(--gold-2);
  margin-left: 3px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
select {
  width: 100%;
  min-height: 50px;
  background: var(--field-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.3;
  outline: none;
  padding: 13px 14px;
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238c948d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 16px;
  cursor: pointer;
  padding-right: 42px;
}

select:disabled {
  cursor: wait;
  opacity: 0.78;
}

select option {
  color: #111512;
  background: #ffffff;
}

input::placeholder {
  color: var(--placeholder);
}

input:focus,
select:focus {
  border-color: var(--gold);
  background-color: var(--surface);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 18%, transparent);
}

input.invalid,
select.invalid {
  border-color: var(--danger);
}

input.invalid:focus,
select.invalid:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--danger) 16%, transparent);
}

.hint {
  min-height: 16px;
  margin-top: 6px;
  color: var(--danger-soft);
  font-size: 12px;
  line-height: 1.35;
}

button.submit {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  margin-top: 2px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--gold-2), var(--gold) 52%, #e1c980);
  box-shadow: 0 16px 34px rgba(111, 86, 21, 0.24);
  color: #171306;
  cursor: pointer;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform 0.12s, box-shadow 0.12s, opacity 0.12s;
}

button.submit:hover {
  box-shadow: 0 20px 40px rgba(111, 86, 21, 0.3);
  transform: translateY(-1px);
}

button.submit:disabled {
  cursor: not-allowed;
  opacity: 0.72;
  transform: none;
}

.btn-spinner {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(23, 19, 6, 0.28);
  border-top-color: #171306;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

button.submit.is-loading .btn-spinner {
  display: inline-block;
}

.footer-note {
  margin-top: 2px;
  color: var(--text-dim);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.feedback-panel {
  display: none;
  grid-column: 1 / -1;
  max-width: 620px;
  justify-self: center;
  padding: 42px 28px;
  text-align: center;
}

.feedback-panel.show {
  display: block;
}

.registration-panel.hidden {
  display: none;
}

.status-icon {
  width: 64px;
  height: 64px;
  border-radius: 999px;
  margin: 0 auto 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--teal), var(--gold));
  color: #07120f;
}

.status-icon.error {
  background: linear-gradient(135deg, var(--danger), #ef9d9d);
}

.status-icon .icon {
  width: 30px;
  height: 30px;
}

.feedback-panel h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.feedback-panel p {
  margin: 0;
  color: var(--text-dim);
  font-size: 15px;
  line-height: 1.6;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 960px) {
  body {
    padding-top: 72px;
  }

  .page-shell {
    max-width: 680px;
    min-height: auto;
    grid-template-columns: 1fr;
    gap: 24px;
    align-items: center;
  }

  .event-panel {
    width: min(480px, 100%);
    height: auto;
  }

  .event-art {
    height: auto;
    min-height: 0;
    aspect-ratio: 4 / 5;
  }
}

@media (max-width: 620px) {
  body {
    padding: 68px 14px 32px;
  }

  .theme-toggle {
    top: 14px;
    right: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .event-meta {
    grid-template-columns: 1fr;
  }

  .meta-item {
    min-height: 64px;
    grid-template-columns: 36px minmax(0, 1fr);
    align-items: center;
  }

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

  .registration-panel {
    padding: 22px;
  }
}
