@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&family=Source+Serif+4:opsz,wght@8..60,600&display=swap');

/* ===== Serra – Incidencias tecnológicas (ámbito .serra-scope) ===== */
.serra-scope {
  --page: #edf4f7;
  --surface: #ffffff;
  --surface-soft: #f5f9fa;
  --ink: #17272d;
  --muted: #5b6d73;
  --line: #d8e3e6;
  --line-strong: #c3d2d7;
  --brand: #0b7584;
  --brand-deep: #085967;
  --brand-soft: #dceff1;
  --accent: #e98238;
  --accent-soft: #fff0e4;
  --success: #267858;
  --success-soft: #e2f2eb;
  --shadow: 0 18px 50px rgba(19, 55, 64, .10);
  --focus: 0 0 0 3px rgba(11, 117, 132, .22);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  color: var(--ink);
}
@media (prefers-color-scheme: dark) {
  .serra-scope {
    --surface: #162226;
    --surface-soft: #1c2b30;
    --ink: #edf5f6;
    --muted: #aec0c5;
    --line: #2d4147;
    --line-strong: #40575e;
    --brand: #55bdc8;
    --brand-deep: #8dd3da;
    --brand-soft: #183a40;
    --accent: #f2a264;
    --accent-soft: #4b2c1a;
    --success: #73c7a3;
    --success-soft: #183b2f;
    --shadow: 0 18px 55px rgba(0, 0, 0, .28);
    --focus: 0 0 0 3px rgba(85, 189, 200, .25);
  }
}
.serra-scope * { box-sizing: border-box; }
.serra-scope button { cursor: pointer; font: inherit; }
.serra-scope input, .serra-scope select, .serra-scope textarea { font: inherit; }
.serra-scope svg { display: block; }
.serra-scope [hidden] { display: none !important; }

/* ---------- Cabecera ---------- */
.serra-intro {
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr);
  align-items: center;
  gap: clamp(20px, 3vw, 42px);
  margin-bottom: 14px;
}
.serra-stage {
  position: relative;
  display: flex;
  min-height: 218px;
  align-items: flex-end;
  justify-content: center;
  isolation: isolate;
}
.serra-button {
  position: relative;
  width: 112px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 12px;
  transform-origin: 50% 100%;
}
.serra-button:focus-visible { outline: none; box-shadow: var(--focus); }
/* El tema pinta de rosa los botones al pulsarlos: lo neutralizamos */
.serra-scope button { -webkit-tap-highlight-color: transparent; }
/* El tema también les pone fondo/borde rosa al enfocarlos: ver bloque de neutralización al final del archivo */
.serra-character {
  display: block;
  width: 100%;
  max-height: 218px;
  object-fit: contain;
  filter: drop-shadow(0 13px 13px rgba(19, 55, 64, .16));
  transform-origin: 50% 100%;
}
.serra-stage[data-state="thinking"] .serra-button { animation: serra-think .52s ease both; }
.serra-stage[data-state="speaking"] .serra-button { animation: serra-talk .62s ease both; }
@keyframes serra-think { from { transform: rotate(0); } to { transform: rotate(-1.7deg); } }
@keyframes serra-talk { 0%, 100% { transform: translateY(0); } 38% { transform: translateY(-9px); } 70% { transform: translateY(-2px); } }

.serra-welcome {
  position: relative;
  z-index: 4;
  grid-column: 1 / -1;
  width: min(520px, 100%);
  margin: -12px 0 0 18px;
  padding: 12px 14px;
  color: #fff;
  background: var(--brand-deep);
  border: 1px solid var(--brand-deep);
  border-radius: 7px 15px 15px 15px;
  box-shadow: 0 12px 28px rgba(19, 55, 64, .14);
  font-size: .82rem;
  font-weight: 600;
  line-height: 1.45;
}
.serra-welcome::before {
  content: "";
  position: absolute;
  left: 57px;
  top: -9px;
  width: 16px;
  height: 16px;
  background: var(--brand-deep);
  border-left: 1px solid var(--brand-deep);
  border-top: 1px solid var(--brand-deep);
  transform: rotate(45deg);
}
.serra-welcome button {
  position: absolute;
  top: 4px;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  color: rgba(255,255,255,.78);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.15rem;
  line-height: 1;
}
.serra-welcome button:hover { color: #fff; background: rgba(255,255,255,.12); }
.serra-welcome p { margin: 0; padding-right: 18px; }

.serra-heading-lockup { display: flex; align-items: center; gap: clamp(16px, 2.1vw, 28px); }
.serra-logo { width: clamp(66px, 7vw, 92px); height: auto; flex: 0 0 auto; object-fit: contain; }
.serra-title {
  margin: 0;
  max-width: 780px;
  color: var(--ink);
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(2.35rem, 5vw, 4.9rem);
  line-height: .98;
  letter-spacing: -.045em;
}
.serra-intro-copy > p { margin: 18px 0 0; max-width: 650px; color: var(--muted); font-size: clamp(1rem, 1.2vw, 1.13rem); }

/* ---------- Tabla ---------- */
.serra-panel { background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.serra-list-panel { min-width: 0; border-radius: 18px 18px 8px 8px; overflow: hidden; }
.serra-list-panel::before { content: ""; display: block; height: 7px; background: #0b7584; }
.serra-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 22px 24px 18px; border-bottom: 1px solid var(--line); }
.serra-panel-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: -.015em; }
.serra-toolbar { display: grid; grid-template-columns: minmax(170px, 1fr) 165px; gap: 10px; padding: 14px 18px; background: var(--surface-soft); border-bottom: 1px solid var(--line); }
.serra-search-wrap { position: relative; }
.serra-search-wrap svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.serra-search-wrap .serra-control { padding-left: 36px; }
.serra-control { width: 100%; min-height: 42px; padding: 9px 12px; color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: 8px; outline: none; }
.serra-control:focus { border-color: var(--brand); box-shadow: var(--focus); }
.serra-table-wrap { overflow: hidden; }
.serra-scope table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.serra-scope thead th { padding: 11px 14px; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--line); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; text-align: left; }
.serra-scope tbody td { padding: 13px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
.serra-scope tbody tr:last-child td { border-bottom: 0; }
.serra-scope tbody tr:hover { background: var(--surface-soft); }
.serra-date-cell { white-space: nowrap; font-size: .88rem; }
.serra-person { font-weight: 700; }
.serra-description { font-weight: 500; }
.serra-status { display: inline-flex; align-items: center; gap: 7px; padding: 5px 9px; border-radius: 999px; font-size: .73rem; font-weight: 800; white-space: nowrap; }
.serra-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.serra-pending { color: #a04f15; background: var(--accent-soft); }
.serra-review { color: var(--brand-deep); background: var(--brand-soft); }
.serra-resolved { color: var(--success); background: var(--success-soft); }
.serra-empty { display: none; padding: 42px 20px; color: var(--muted); text-align: center; }

/* ---------- Chat ---------- */
.serra-chat-panel {
  position: fixed;
  z-index: 30;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-rows: auto minmax(170px, 1fr) auto;
  width: min(390px, calc(100vw - 36px));
  max-height: min(610px, calc(100vh - 36px));
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 18px 18px 8px 18px;
  box-shadow: 0 24px 70px rgba(13, 45, 54, .28);
  font-family: "Manrope", sans-serif;
  font-size: 15px;
}
.serra-chat-panel[hidden] { display: none; }
.serra-chat-head { display: flex; align-items: center; gap: 11px; padding: 14px 15px; color: #fff; background: var(--brand-deep); }
.serra-chat-head-copy { min-width: 0; flex: 1; }
.serra-chat-head strong { display: block; font-size: .95rem; }
.serra-chat-head span { display: block; color: rgba(255,255,255,.78); font-size: .73rem; }
.serra-chat-close { width: 34px; height: 34px; padding: 0; flex: 0 0 auto; color: #fff; background: rgba(255,255,255,.11); border: 0; border-radius: 50%; font-size: 1.35rem; line-height: 1; }
.serra-chat-close:hover { background: rgba(255,255,255,.2); }
.serra-chat-log { overflow-y: auto; padding: 16px; background: var(--surface-soft); scroll-behavior: smooth; }
.serra-chat-message { display: flex; margin-bottom: 12px; }
.serra-chat-message.user { justify-content: flex-end; }
.serra-bubble { max-width: 88%; padding: 10px 12px; border-radius: 6px 14px 14px 14px; background: var(--brand-soft); color: var(--ink); font-size: .85rem; line-height: 1.46; }
.serra-chat-message.user .serra-bubble { color: #fff; background: var(--brand-deep); border-radius: 14px 6px 14px 14px; }
.serra-chat-message.serra.is-new .serra-bubble { animation: serra-answer-bounce .55s ease both; }
@keyframes serra-answer-bounce { 0% { opacity: 0; transform: translateY(8px) scale(.96); } 55% { opacity: 1; transform: translateY(-4px) scale(1.015); } 100% { transform: none; } }
.serra-typing { display: inline-flex; align-items: center; gap: 5px; min-width: 56px; }
.serra-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--brand); animation: serra-typing-dot .85s infinite ease-in-out; }
.serra-typing i:nth-child(2) { animation-delay: .12s; }
.serra-typing i:nth-child(3) { animation-delay: .24s; }
@keyframes serra-typing-dot { 0%, 65%, 100% { opacity: .35; transform: translateY(0); } 32% { opacity: 1; transform: translateY(-3px); } }
.serra-choices { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.serra-choice { padding: 8px 12px; color: var(--brand-deep); background: var(--surface); border: 1.5px solid var(--brand); border-radius: 999px; font-size: .78rem; font-weight: 700; }
.serra-choice:hover { background: var(--brand-soft); }
.serra-choice.primary-choice { color: #fff; background: var(--brand-deep); border-color: var(--brand-deep); }
.serra-compose { display: grid; grid-template-columns: 1fr 44px; gap: 8px; padding: 12px; background: var(--surface); }
.serra-scope .serra-chat-input { min-width: 0; min-height: 44px; padding: 10px 12px; color: var(--ink); background: #fff; border: 1.5px solid var(--brand); border-radius: 9px; outline: none; }
.serra-scope .serra-chat-input:focus { border-color: var(--brand); box-shadow: var(--focus); outline: none; }
.serra-chat-send { display: grid; width: 44px; height: 44px; place-items: center; padding: 0; color: #fff; background: var(--brand-deep); border: 0; border-radius: 9px; }
.serra-chat-send:hover { background: var(--brand); }
.serra-chat-send:disabled { cursor: wait; opacity: .55; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .serra-intro { grid-template-columns: 128px minmax(0, 1fr); }
}
@media (max-width: 700px) {
  .serra-intro { grid-template-columns: 88px minmax(0, 1fr); gap: 10px 14px; margin-bottom: 20px; }
  .serra-stage { min-height: 158px; align-self: start; }
  .serra-button { width: 78px; }
  .serra-character { max-height: 158px; filter: drop-shadow(0 8px 9px rgba(19,55,64,.14)); }
  .serra-welcome { width: 100%; min-width: 0; margin: 0; font-size: .78rem; }
  .serra-welcome::before { left: 31px; top: -9px; }
  .serra-heading-lockup { align-items: flex-start; gap: 9px; }
  .serra-logo { width: 42px; margin-top: 2px; }
  .serra-title { font-size: clamp(2rem, 10vw, 2.7rem); }
  .serra-intro-copy > p { margin-top: 10px; font-size: .9rem; }
  .serra-toolbar { grid-template-columns: 1fr; }
  .serra-panel-head { padding: 18px; }
  .serra-table-wrap { padding: 10px 12px 12px; }
  .serra-scope table, .serra-scope thead, .serra-scope tbody, .serra-scope tr, .serra-scope td { display: block; width: 100%; }
  .serra-scope thead { display: none; }
  .serra-scope tbody { display: grid; gap: 10px; }
  .serra-scope tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; padding: 15px; background: var(--surface-soft); border: 1px solid var(--line); border-radius: 10px; }
  .serra-scope tbody tr:hover { background: var(--surface-soft); }
  .serra-scope td { padding: 0; border: 0; }
  .serra-scope td[data-label="Docente"] { grid-column: 1; grid-row: 1; }
  .serra-scope td[data-label="Estado"] { grid-column: 2; grid-row: 1; }
  .serra-scope td[data-label="Clase"] { grid-column: 1 / -1; grid-row: 2; font-size: .85rem; }
  .serra-scope td[data-label="Descripción"] { grid-column: 1 / -1; grid-row: 3; padding-top: 7px; border-top: 1px solid var(--line); }
  .serra-scope td[data-label="Fecha"] { grid-column: 1 / -1; grid-row: 4; }
  .serra-chat-panel { inset: auto 8px max(8px, env(safe-area-inset-bottom)) 8px; width: auto; max-height: min(72vh, 620px); border-radius: 16px 16px 8px 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .serra-scope *, .serra-scope *::before, .serra-scope *::after,
  .serra-chat-panel *, .serra-chat-panel *::before, .serra-chat-panel *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

/* ===== Fondo azul de la demo en toda la página ===== */
body.page-id-1407 {
  background: #edf4f7 !important;
  background: linear-gradient(180deg, rgba(220, 239, 241, .75), rgba(220, 239, 241, 0) 420px), #edf4f7 !important;
}
.serra-scope {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin-bottom: 14px;
}
.serra-scope .serra-chat-panel { border-radius: 18px; }

/* ===== Formulario Fluent Forms con el estilo de la demo ===== */
.fluentform_wrapper_3 {
  position: sticky;
  top: 20px;
  background: #fff;
  border: 1px solid #d8e3e6;
  border-radius: 8px 18px 18px 8px;
  overflow: hidden;
  padding: 0 20px 22px;
  box-shadow: 0 18px 50px rgba(19, 55, 64, .10);
}
.fluentform_wrapper_3::before {
  content: "";
  display: block;
  height: 7px;
  background: #0b7584;
  margin: 0 -20px 18px;
}
#fluentform_3 .ff-el-input--label { font-weight: 700; color: #17272d; margin-bottom: 6px; }
#fluentform_3 .ff-el-input--label .ff-required { color: #c0392b; }
#fluentform_3 .ff-el-form-control {
  border: 1.5px solid #c3d2d7;
  border-radius: 12px;
  padding: 11px 14px;
  background: #fff;
  color: #17272d;
}
#fluentform_3 .ff-el-form-control:focus {
  border-color: #0b7584;
  box-shadow: 0 0 0 3px rgba(11, 117, 132, .18);
  outline: none;
}
#fluentform_3 .ff-el-is-error .ff-el-form-control { border-color: #c0392b; }
#fluentform_3 .ff-el-input--content { margin-bottom: 4px; }
#fluentform_3 .ff-btn-submit {
  background: #0b7584;
  border: none;
  border-radius: 12px;
  padding: 13px 26px;
  font-weight: 800;
  color: #fff;
  width: 100%;
}
#fluentform_3 .ff-btn-submit:hover { background: #085967; }

/* Título de la tarjeta del formulario (como la demo) */
.serra-form-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 5px; }
.serra-form-title h2 { font-size: 1.35rem; margin: 0; letter-spacing: -.015em; color: #17272d; }
.serra-form-title svg { color: #0b7584; flex: none; }

/* ===== Neutralización del tema Hello Elementor =====
   El tema pinta los <button> de rosa (#c36) en :hover/:focus y su hoja carga
   después de la nuestra, así que estas reglas van con más especificidad para
   imponerse siempre, conservando el diseño propio de cada botón. */
.serra-scope .serra-button,
.serra-scope .serra-button:hover,
.serra-scope .serra-button:focus,
.serra-scope .serra-button:active { background: transparent; border: 0; outline: none; }
.serra-scope .serra-button:focus-visible { box-shadow: var(--focus); }
.serra-scope .serra-welcome-close,
.serra-scope .serra-welcome-close:hover,
.serra-scope .serra-welcome-close:focus,
.serra-scope .serra-welcome-close:active { background: transparent; border: 0; outline: none; color: #fff; }
.serra-scope .serra-chat-close,
.serra-scope .serra-chat-close:focus,
.serra-scope .serra-chat-close:active { background: rgba(255,255,255,.11); border: 0; outline: none; color: #fff; }
.serra-scope .serra-chat-close:hover { background: rgba(255,255,255,.2); border: 0; }
.serra-scope .serra-chat-send,
.serra-scope .serra-chat-send:focus,
.serra-scope .serra-chat-send:active { background: var(--brand-deep); border: 0; outline: none; color: #fff; }
.serra-scope .serra-chat-send:hover { background: var(--brand); border: 0; }
.serra-scope .serra-choice,
.serra-scope .serra-choice:focus,
.serra-scope .serra-choice:active { background: var(--surface); border: 1.5px solid var(--brand); outline: none; color: var(--brand-deep); }
.serra-scope .serra-choice:hover { background: var(--brand-soft); border: 1.5px solid var(--brand); color: var(--brand-deep); }
