/* ── Elección del paso 1 ──────────────────────────────────────────
   Por orden de prioridad (issue #240): militar, pasar de simpatizante a
   militante y, en último lugar, inscribirse como simpatizante. */

/* Cabecera: más baja en el móvil, con el enlace de vuelta dentro */

.header {
    height: auto;
    padding: 14px 0;
}

.header-wrapper {
    /* base.html has no doctype: in quirks mode 100% would be the whole viewport */
    height: auto;
    max-width: 700px;
    padding: 0 16px;
    gap: 1rem;
}

.header .logo {
    width: 132px;
}

.header-back,
.header-back:link,
.header-back:visited {
    color: #faf3e0;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.85rem;
    font-weight: 500;
    white-space: nowrap;
}

.header-back:hover,
.header-back:focus {
    color: var(--color-primary);
}

@media (min-width: 768px) {
    .header { padding: 24px 0; }
    .header .logo { width: 180px; }
    .header-back { font-size: 1rem; }
}

/* La página ocupa al menos la pantalla y el pie queda abajo, sin crema debajo */

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.landing-section {
    /* flex item with auto margins: without this it shrinks to its content */
    width: 100%;
}

.wizard-section {
    padding-bottom: 2.5rem;
}

/* Únete: franja oscura con trama, alineada con el panel de debajo */

.join-hero {
    position: relative;
    background: var(--color-accent);
    color: #faf3e0;
    overflow: hidden;
}

.join-hero::before {
    /* Celosía de estrellas de ocho puntas, de inspiración andalusí, que se desvanece
       hacia la izquierda para no competir con el texto */
    content: "";
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cg fill='none' stroke='%2300ff8d' stroke-opacity='0.28' stroke-width='1'%3E%3Crect x='13' y='13' width='22' height='22'/%3E%3Cpath d='M24 8.4 39.6 24 24 39.6 8.4 24Z'/%3E%3Cpath d='M0 0 13 13M48 0 35 13M0 48 13 35M48 48 35 35M24 0v8.4M24 48v-8.4M0 24h8.4M48 24h-8.4'/%3E%3C/g%3E%3C/svg%3E");
    background-size: 48px 48px;
    -webkit-mask-image:
        linear-gradient(to left, #000 10%, transparent 75%),
        linear-gradient(to bottom, transparent, #000 45%);
    -webkit-mask-composite: source-in;
    mask-image:
        linear-gradient(to left, #000 10%, transparent 75%),
        linear-gradient(to bottom, transparent, #000 45%);
    mask-composite: intersect;
    pointer-events: none;
}

.join-hero__inner {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
    padding: 0.5rem 1rem 1.5rem;
}

.join-hero + .wizard-section #step-choose.join-overlap {
    /* Sin nada en medio, el panel monta sobre la franja */
    position: relative;
    z-index: 1;
    margin-top: -6rem;
}

.join-hero:has(+ .wizard-section) .join-hero__inner {
    padding-bottom: 8rem;
}

.join-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: clamp(1.75rem, 7vw, 2.4rem);
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.08;
    color: #faf3e0;
    margin: 0 0 0.7rem;
}

.join-lead {
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    line-height: 1.5;
    color: rgba(250, 243, 224, 0.88);
    margin: 0;
    max-width: 34em;
}

.join-note {
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.45;
    color: rgba(250, 243, 224, 0.65);
    margin: 0.6rem 0 0;
    max-width: 38em;
}

@media (min-width: 600px) {
    .join-hero__inner { padding-top: 1.5rem; }
}

/* El panel de las opciones */

#step-choose.wizard-panel {
    margin-top: 1.25rem;
    padding: 1.25rem;
}

@media (min-width: 600px) {
    #step-choose.wizard-panel {
        padding: 1.75rem 2rem;
    }
}

/* Militante: la opción principal */

.choice-militant {
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
    border-radius: 14px;
    background-color: var(--color-accent);
    /* Estrella de ocho puntas en línea, recortada en la esquina: el motivo de la celosía */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cg fill='none' stroke='%2300ff8d' stroke-opacity='0.22' stroke-width='1.2'%3E%3Crect x='20' y='20' width='60' height='60'/%3E%3Crect x='20' y='20' width='60' height='60' transform='rotate(45 50 50)'/%3E%3Crect x='31' y='31' width='38' height='38'/%3E%3Crect x='31' y='31' width='38' height='38' transform='rotate(45 50 50)'/%3E%3Ccircle cx='50' cy='50' r='9'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-size: 300px 300px;
    background-position: right -120px center;
    color: #faf3e0;
}

.choice-militant > * {
    position: relative;
}

.choice-militant__name {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: #faf3e0;
    margin: 0 0 0.75rem;
}

.choice-militant__points {
    list-style: none;
    padding: 0;
    margin: 0 0 1.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.45;
}

.choice-militant__points li {
    position: relative;
    padding-left: 1.4rem;
}

.choice-militant__points li + li {
    margin-top: 0.35rem;
}

.choice-militant__points li::before {
    content: "✓";
    position: absolute;
    left: 0;
    font-weight: 700;
    color: var(--color-primary);
}

.choice-militant__button {
    /* resets for global button styles */
    float: none;
    text-transform: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: none;
    border-radius: 10px;
    background: var(--color-primary);
    color: var(--color-accent);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
}

.choice-militant__button:hover {
    background: #24c87f;
}

.choice-arrow {
    flex: none;
    transition: transform 150ms ease;
}

.choice-militant__button:hover .choice-arrow,
.choice-upgrade__link:hover .choice-arrow {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .choice-arrow { transition: none; }
}

.choice-militant__button:focus-visible {
    outline: 3px solid #faf3e0;
    outline-offset: 2px;
}

/* De simpatizante a militante: segunda, en una fila */

.choice-upgrade {
    margin: 0.75rem 0 0;
    padding: 0.85rem 1rem;
    border: 1px solid #b6f2d6;
    border-radius: 12px;
    background: #e6fff5;
    font-family: 'Inter', sans-serif;
    font-size: 0.92rem;
    color: var(--color-accent);
}

.choice-upgrade > span {
    display: block;
    margin-bottom: 0.15rem;
}

.choice-upgrade__link,
.choice-sympathizer__link,
.militant-nudge__link {
    /* resets for global button styles */
    float: none;
    text-transform: none;
    background: none;
    border: none;
    padding: 0;
    text-align: left;
    font-size: inherit;
    color: var(--color-accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}

.choice-upgrade__link,
.militant-nudge__link {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 700;
}

.choice-upgrade__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.15rem;
}

.choice-upgrade__icon {
    flex: none;
    color: #24c87f;
}

.choice-upgrade__link:hover,
.choice-sympathizer__link:hover,
.militant-nudge__link:hover {
    color: #24c87f;
}

.choice-upgrade__link:focus-visible,
.choice-sympathizer__link:focus-visible,
.militant-nudge__link:focus-visible {
    outline: 3px solid var(--color-primary);
    outline-offset: 2px;
}

/* Simpatizante: la última, como enlace */

.choice-sympathizer {
    margin: 1.1rem 0 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    color: var(--color-muted);
}

.choice-sympathizer__link {
    font-family: 'Inter', sans-serif;
}

/* Resumen de simpatizante: pasarse a militante con lo ya escrito */

.militant-nudge {
    margin-top: 1.25rem;
    padding: 0.9rem 1rem;
    border-left: 3px solid var(--color-primary);
    background: #f5f0e8;
    border-radius: 0 10px 10px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--color-accent);
}

.militant-nudge p {
    margin: 0 0 0.4rem;
    line-height: 1.5;
}

/* Pie: un solo bloque oscuro, alineado con el panel */

.site-footer {
    margin-top: auto;
    background: #002c2c;
    color: rgba(250, 243, 224, 0.75);
}

.site-footer__inner {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 1rem 1.75rem;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    line-height: 1.5;
}

.site-footer p {
    margin: 0;
}

.site-footer a:link,
.site-footer a:visited {
    color: #faf3e0;
    font-size: inherit;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* style.css pins footer links to white with !important: hover marks the underline */
.site-footer a:hover,
.site-footer a:focus {
    text-decoration-color: var(--color-primary);
}

/* Paso 1 ⇄ asistente (view transition, ver render() en landing.js)
   Al elegir, la franja se recoge hacia la cabecera con aceleración y frenada, el
   panel de opciones sube y se va con ella, y el primer paso entra desde abajo con
   un poco de retraso. «Atrás» hace lo mismo al revés. Los nombres solo existen
   mientras dura la transición. */

:root[data-join-transition] .join-hero { view-transition-name: join-hero; }
:root[data-join-transition] #step-choose { view-transition-name: join-choice; }
:root[data-join-transition] .wizard-form [data-step] { view-transition-name: wizard-step; }
:root[data-join-transition] #wizard-progress { view-transition-name: wizard-progress; }
:root[data-join-transition] .site-footer { view-transition-name: site-footer; }

@keyframes join-band-fold {
    from { clip-path: inset(0 0 0 0); }
    to { clip-path: inset(0 0 100% 0); }
}

@keyframes join-band-unfold {
    from { clip-path: inset(0 0 100% 0); }
    to { clip-path: inset(0 0 0 0); }
}

@keyframes join-lift-out {
    to { opacity: 0; transform: translateY(-72px) scale(0.96); }
}

@keyframes join-sink-out {
    to { opacity: 0; transform: translateY(48px) scale(0.98); }
}

@keyframes join-rise-in {
    from { opacity: 0; transform: translateY(64px) scale(0.98); }
}

@keyframes join-drop-in {
    from { opacity: 0; transform: translateY(-16px); }
}

/* El resto de la página no cambia: sin fundido, que en el móvil deja fantasmas */
:root[data-join-transition]::view-transition-old(root),
:root[data-join-transition]::view-transition-new(root) {
    animation: none;
}

::view-transition-group(site-footer) {
    animation-duration: 750ms;
    animation-timing-function: cubic-bezier(0.5, 0, 0.15, 1);
}

/* Hacia el asistente */

:root[data-join-transition="forward"]::view-transition-old(join-hero) {
    animation: join-band-fold 750ms cubic-bezier(0.5, 0, 0.15, 1) both;
}

:root[data-join-transition="forward"]::view-transition-old(join-choice) {
    animation: join-lift-out 380ms cubic-bezier(0.55, 0, 1, 0.45) both;
}

:root[data-join-transition="forward"]::view-transition-new(wizard-step) {
    animation: join-rise-in 750ms cubic-bezier(0.16, 1, 0.3, 1) 300ms both;
}

:root[data-join-transition="forward"]::view-transition-new(wizard-progress) {
    animation: join-drop-in 550ms cubic-bezier(0.16, 1, 0.3, 1) 420ms both;
}

/* De vuelta al paso 1 */

:root[data-join-transition="back"]::view-transition-new(join-hero) {
    animation: join-band-unfold 750ms cubic-bezier(0.5, 0, 0.15, 1) both;
}

:root[data-join-transition="back"]::view-transition-old(wizard-step) {
    animation: join-sink-out 300ms cubic-bezier(0.55, 0, 1, 0.45) both;
}

:root[data-join-transition="back"]::view-transition-old(wizard-progress) {
    animation: join-lift-out 250ms cubic-bezier(0.55, 0, 1, 0.45) both;
}

:root[data-join-transition="back"]::view-transition-new(join-choice) {
    animation: join-rise-in 750ms cubic-bezier(0.16, 1, 0.3, 1) 280ms both;
}
