/* ============================================================
   Preguntas en Directo — identidad visual
   Color principal de marca: #21498F (azul institucional)
   Paleta: papel cálido + tinta azul-marino + acento azul de marca
   Tipografía: Fraunces (titulares editoriales) + Inter (interfaz)
   ============================================================ */

:root {
    --paper:      #F1EFE8;
    --paper-dim:  #E7E4DA;
    --ink:        #14213D;   /* azul-marino oscuro, derivado del azul de marca */
    --ink-soft:   #46527A;
    --muted:      #767C8C;
    --line:       #D9DBD6;

    --blue:       #21498F;   /* color principal de marca */
    --blue-dark:  #17356B;   /* hover / bordes sobre fondo claro */
    --blue-light: #5C82C4;   /* acentos sobre fondo oscuro */
    --blue-line:  #26355C;   /* líneas divisorias sobre fondo oscuro */
    --blue-panel: #1C2E54;   /* superficies sobre fondo oscuro */

    --live:       #A6382E;
    --live-bg:    #F6E3E0;
    --answered:   #3E6B4C;
    --answered-bg:#E1EBE2;
    --hidden-bg:  #E9E8E3;
    --radius:     3px;
    --shadow:     0 1px 2px rgba(20,33,61,.08);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3, .display {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--ink);
    margin: 0 0 .3em;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; color: var(--blue-dark); }

.wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.wrap--wide { max-width: 980px; }

/* --- cabecera de marca, discreta, sin caja --- */
.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 36px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
}
.brand__mark {
    width: 10px; height: 10px;
    border-radius: 50%;
    background: var(--blue);
    flex: none;
}
.brand__logo {
    height: 34px;
    width: auto;
    max-width: 180px;
    display: block;
    flex: none;
    object-fit: contain;
}
.brand__name {
    font-family: 'Fraunces', serif;
    font-weight: 600;
    font-size: 18px;
}
.brand__meta {
    margin-left: auto;
    font-size: 13px;
    color: var(--muted);
}

/* --- formularios --- */
label {
    display: block;
    font-size: 13px;
    color: var(--ink-soft);
    margin: 22px 0 6px;
}
label:first-of-type {  }

input[type=text], input[type=password], textarea, select {
    width: 100%;
    font-family: inherit;
    font-size: 16px;
    padding: 11px 13px;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius);
    color: var(--ink);
}
input:focus, textarea:focus, select:focus {
    outline: 2px solid var(--blue);
    outline-offset: 1px;
    border-color: var(--blue);
}
textarea { resize: vertical; min-height: 110px; }

.choice-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}
.choice {
    border: 1px solid var(--line);
    background: #fff;
    padding: 8px 14px;
    border-radius: 20px;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
}
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice.is-active {
    border-color: var(--blue-dark);
    background: var(--blue);
    color: #fff;
    font-weight: 500;
}

button, .btn {
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 22px;
    border-radius: var(--radius);
    border: 1px solid var(--blue);
    background: var(--blue);
    color: #fff;
    cursor: pointer;
}
button:hover, .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
button.secondary, .btn.secondary {
    background: transparent;
    border-color: var(--line);
    color: var(--ink);
}
button.secondary:hover, .btn.secondary:hover { background: var(--paper-dim); border-color: var(--line); }
button:disabled { opacity: .5; cursor: default; }

.actions { margin-top: 28px; display: flex; gap: 10px; align-items: center; }

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.error { color: var(--live); font-size: 14px; margin-top: 10px; }

/* --- confirmación tras enviar pregunta --- */
.confirm {
    display: none;
    margin-top: 24px;
    padding: 18px 20px;
    background: var(--answered-bg);
    border-left: 3px solid var(--answered);
    border-radius: var(--radius);
}
.confirm.is-visible { display: block; }

/* --- listados tipo editorial (sin tarjetas, con separadores) --- */
.list-row {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--line);
    align-items: flex-start;
}
.list-row:last-child { border-bottom: none; }
.list-row__num {
    font-family: 'Fraunces', serif;
    font-size: 20px;
    color: var(--muted);
    width: 30px;
    flex: none;
    text-align: right;
}
.list-row__body { flex: 1; min-width: 0; }
.list-row__title { font-weight: 600; font-size: 17px; margin-bottom: 3px; }
.list-row__meta { font-size: 13px; color: var(--muted); }

/* --- tabla simple de administración --- */
table { width: 100%; border-collapse: collapse; font-size: 15px; }
th, td { text-align: left; padding: 12px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 500; font-size: 13px; }

/* --- pantalla de moderación en vivo --- */
.live-shell {
    background: var(--ink);
    color: var(--paper);
    min-height: 100vh;
}
.live-top {
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 18px 28px;
    border-bottom: 1px solid var(--blue-line);
    position: sticky;
    top: 0;
    background: var(--ink);
    z-index: 5;
}
.live-top .brand__logo, .live-top .brand__mark { flex: none; }
.live-top h1 { color: #fff; font-size: 20px; margin: 0; }
.live-top .topic { color: #9CA6C2; font-size: 14px; }
.live-status {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #9CA6C2;
}
.live-dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: var(--answered);
    animation: pulse 2s infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
@media (prefers-reduced-motion: reduce) { .live-dot { animation: none; } }

.live-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 16px 28px;
    border-bottom: 1px solid var(--blue-line);
}
.filter-pill {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid var(--blue-line);
    color: #C6CEE0;
    cursor: pointer;
    background: transparent;
}
.filter-pill.is-active { background: var(--blue); border-color: var(--blue); color: #fff; }
.filter-pill span.count { opacity: .7; margin-left: 4px; }

.live-list { padding: 8px 28px 60px; max-width: 900px; margin: 0 auto; }

.q-row {
    display: flex;
    gap: 16px;
    padding: 18px 0;
    border-bottom: 1px solid var(--blue-line);
    opacity: 0;
    animation: appear .4s ease forwards;
}
@media (prefers-reduced-motion: reduce) { .q-row { animation: none; opacity: 1; } }
@keyframes appear { to { opacity: 1; } }
.q-row.is-answered { opacity: .55; }
.q-row.is-new .q-text { box-shadow: inset 3px 0 0 var(--blue-light); padding-left: 12px; }

.q-num { font-family:'Fraunces',serif; font-size: 18px; color: #5C6690; width: 30px; flex: none; text-align: right; }
.q-body { flex: 1; min-width: 0; }
.q-meta { display: flex; gap: 10px; align-items: center; font-size: 13px; color: #9CA6C2; margin-bottom: 6px; flex-wrap: wrap; }
.q-author { color: #fff; font-weight: 600; }
.q-target {
    font-size: 12px;
    padding: 2px 9px;
    border-radius: 12px;
    background: var(--blue-panel);
    color: #C6CEE0;
}
.q-target.is-all { background: var(--live-bg); color: var(--live); }
.q-text { font-size: 17px; color: #ECEEF5; line-height: 1.45; }
.q-actions { display: flex; gap: 8px; margin-top: 10px; }
.q-actions button {
    font-size: 12px;
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--blue-line);
    color: #C6CEE0;
}
.q-actions button:hover { background: var(--blue-panel); border-color: var(--blue-line); }
.q-actions button.mark-answered:hover { border-color: var(--answered); color: #fff; }
.q-actions button.mark-hidden:hover { border-color: var(--live); color: #fff; }

.empty-state { padding: 60px 0; text-align: center; color: #5C6690; }

/* --- admin: badges de estado --- */
.badge { font-size: 12px; padding: 3px 9px; border-radius: 12px; }
.badge.active { background: var(--answered-bg); color: var(--answered); }
.badge.inactive { background: var(--hidden-bg); color: var(--muted); }

.qr-box { text-align: center; padding: 30px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.qr-box img { max-width: 260px; }
.share-link {
    display: block;
    margin-top: 16px;
    padding: 10px 14px;
    background: var(--paper-dim);
    border-radius: var(--radius);
    font-size: 14px;
    word-break: break-all;
}

.member-fields .member-field { display: flex; gap: 8px; margin-bottom: 8px; }
.member-fields .member-field input { flex: 1; }
.member-fields .member-field button { padding: 0 12px; }

@media (max-width: 640px) {
    .wrap { padding: 28px 18px 60px; }
    .live-top, .live-filters, .live-list { padding-left: 18px; padding-right: 18px; }
}