/* happen.how v11 — 2026-04-10 */
@import url('https://fonts.googleapis.com/css2?family=Work+Sans:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

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

:root {
  --black: #0a0a0a;
  --white: #ffffff;
  --gray: #888;
  --light-gray: #e8e8e8;
  --font: 'Work Sans', sans-serif;
  --max-width: clamp(300px, 55vw, 1056px);
  --margin: clamp(16px, 4vw, 48px);
  --top-offset: 120px;
}

html { font-size: 18px; scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--white);
  color: var(--black);
  line-height: 1.7;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: hidden; /* evita scroll horizontal por videos full-bleed */
}

/* HEADER */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  padding: 16px var(--margin);
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
  display: flex;
  justify-content: center;
  align-items: center;
}
header.scrolled { border-bottom-color: var(--light-gray); }

.logo-link { display: inline-block; text-decoration: none; }
.logo-link img {
  height: 48px;
  width: auto;
  display: block;
}

/* MAIN CONTENT */
main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--top-offset) var(--margin) 80px;
  min-height: 100vh;
}

/* PAGE TRANSITIONS */
.page { display: none; animation: fadeIn 0.4s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* TYPOGRAPHY */
p { margin-bottom: 1.4em; font-size: 1.1rem; }
p:last-child { margin-bottom: 0; }

/* LINKS */
a.text-link {
  color: var(--black);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: opacity 0.2s;
}
a.text-link:hover { opacity: 0.5; }

/* INLINE FORM ELEMENTS */
.inline-form { display: inline; }

.inline-input-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.inline-input {
  display: inline-block;
  font-family: var(--font);
  font-size: 1.1rem;
  font-weight: 300;
  color: var(--black);
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--black);
  outline: none;
  padding: 2px 4px;
  min-width: 120px;
  max-width: 280px;
  width: auto;
  transition: border-color 0.2s;
}
.inline-input:focus { border-bottom-color: var(--black); }
.inline-input::placeholder { color: var(--gray); font-style: italic; }
.inline-input.error { border-bottom-color: #c00; }

/* ARROW BUTTON */
.arrow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--black);
  color: var(--white);
  border: none;
  cursor: pointer;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 1rem;
  transition: transform 0.2s, opacity 0.2s;
  flex-shrink: 0;
  vertical-align: middle;
}
.arrow-btn:hover { transform: scale(1.1); }
.arrow-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* VALIDATION MESSAGE */
.validation-msg {
  display: block;
  font-size: 0.85rem;
  color: #c00;
  margin-top: 6px;
  font-style: italic;
  min-height: 1.2em;
}
.validation-msg.ok { color: #2a7a2a; }

/* STEP CONTENT */
.step-content { animation: fadeIn 0.35s ease; }

/* FORM BLOCK FIELDS (non-inline) */
.field-block { margin: 1.2em 0; }
.field-block label {
  display: block;
  font-size: 0.85rem;
  color: var(--gray);
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.field-block .inline-input { width: 100%; max-width: 400px; }

/* TABLE SCROLL WRAPPER */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5em calc(-1 * var(--margin));
  padding: 0 var(--margin);
}

/* TABLE */
.roles-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  margin: 0;
  font-size: 0.95rem;
}
.roles-table th {
  text-align: left;
  font-weight: 400;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray);
  border-bottom: 1px solid var(--light-gray);
  padding: 6px 8px 8px;
}
.roles-table td {
  padding: 8px;
  border-bottom: 1px solid var(--light-gray);
  vertical-align: middle;
}
.roles-table td input {
  width: 100%;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 300;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--light-gray);
  outline: none;
  padding: 2px 0;
  color: var(--black);
  transition: border-color 0.2s;
}
.roles-table td input:focus { border-bottom-color: var(--black); }
.add-row-btn {
  display: inline-block;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--gray);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  margin-top: 12px;
}
.add-row-btn:hover { color: var(--black); }

/* CONTACT CARDS */
.contact-cards {
  display: flex;
  gap: 32px;
  margin: 2em 0;
  flex-wrap: wrap;
}
.contact-card {
  display: flex;
  align-items: center;
  gap: 16px;
}
.contact-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
}
.contact-card-info { font-size: 0.95rem; line-height: 1.5; }
.contact-card-name { font-weight: 500; }
.contact-card-detail { color: var(--gray); }
.contact-card-detail a { color: var(--gray); text-decoration: none; }
.contact-card-detail a:hover { color: var(--black); }

/* AI RESPONSE BLOCK */
.ai-response {
  margin: 1.5em 0;
  color: var(--black);
}
.ai-response.loading { color: var(--gray); font-style: italic; }
.ai-response.loading::after {
  content: '';
  display: inline-block;
  width: 4px; height: 4px;
  background: var(--gray);
  border-radius: 50%;
  margin-left: 4px;
  animation: blink 1s infinite;
}
@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0} }

/* CALENDAR SLOTS */
.calendar-wrap { margin: 2em 0; }
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin-top: 1em;
}
.slot-btn {
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 300;
  background: transparent;
  border: 1px solid var(--light-gray);
  padding: 10px 14px;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.2s, background 0.2s;
  color: var(--black);
}
.slot-btn:hover { border-color: var(--black); }
.slot-btn.selected { background: var(--black); color: var(--white); border-color: var(--black); }
.slot-loading { color: var(--gray); font-style: italic; font-size: 0.95rem; }

/* VIDEO EMBED */
.video-wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  /* full-bleed: sale del contenedor y ocupa todo el viewport */
  margin: 2em calc(50% - 50vw);
  width: 100vw;
}
.video-wrap iframe {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  border: none;
}
@media (max-width: 700px) {
  .video-wrap { margin: 2em calc(50% - 50vw); width: 100vw; }
}

/* QUALIFICACION PAGINADA */
.qual-question { margin-bottom: 1.2em; }
.qual-input-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 1em;
}
.qual-textarea {
  flex: 1;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 300;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--black);
  outline: none;
  resize: none;
  padding: 4px;
  min-height: 60px;
  line-height: 1.6;
  color: var(--black);
}
.qual-textarea::placeholder { color: var(--gray); font-style: italic; }
.qual-back-hint { margin-top: 1.5em; }

/* EDIT ANSWERS */
.edit-answers-panel {
  margin-top: 2em;
  border-top: 1px solid var(--light-gray);
  padding-top: 1.5em;
  animation: fadeIn 0.3s ease;
}
.edit-answer-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 0.8em;
  flex-wrap: wrap;
}
.edit-answer-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gray);
  min-width: 120px;
}
.edit-answer-value { font-size: 0.95rem; }
.edit-answer-edit {
  font-size: 0.8rem;
  color: var(--gray);
  text-decoration: underline;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  padding: 0;
}

/* SUCCESS STATE */
.success-block { animation: fadeIn 0.5s ease; }

/* MOBILE */
@media (max-width: 600px) {
  :root { --margin: 16px; --top-offset: 88px; }
  html { font-size: 16px; }
  header { padding: 12px var(--margin); }
  .contact-cards { flex-direction: column; gap: 20px; }
  .slot-grid { grid-template-columns: 1fr 1fr; }
  .video-wrap { margin: 1.5em calc(-1 * var(--margin)); }
}
