:root {
    color-scheme: light;
    --bg: #f5f2ed;
    --card: #ffffff;
    --ink: #1a1a1a;
    --muted: #5f5f5f;
    --line: #e7e2db;
    --accent: #0c6c64;
    --accent-soft: rgba(12, 108, 100, 0.12);
    --shadow: 0 30px 80px rgba(10, 22, 21, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Space Grotesk", "IBM Plex Sans", "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #ffffff 0%, #f7f3ee 40%, #efe9e2 100%);
    color: var(--ink);
    min-height: 100vh;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(120deg, rgba(12, 108, 100, 0.08), rgba(255, 255, 255, 0));
    pointer-events: none;
    z-index: 0;
}

.page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 56px 18px;
    position: relative;
    z-index: 1;
}

.card {
    width: min(540px, 100%);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 38px 36px 32px;
    box-shadow: var(--shadow);
    position: relative;
    overflow: visible;
}

.card::after {
    display: none;
}

.card-header {
    text-align: center;
    margin-bottom: 26px;
    position: relative;
    z-index: 1;
}

.logo-ticsur {
    max-width: 220px;
    height: auto;
    margin-bottom: 20px;
}

.info-icon {
    position: absolute;
    top: 15px;
    right: 25px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: var(--accent);
    z-index: 10;
}

.eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    color: var(--accent);
    margin: 0 0 10px 0;
}

h1 {
    font-size: 30px;
    margin: 0 0 10px 0;
}

.subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

.form {
    display: grid;
    gap: 16px;
    position: relative;
    z-index: 1;
}

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

.field {
    display: grid;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.field span {
    font-weight: 600;
    color: var(--ink);
}

.field input {
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--line);
    font-size: 15px;
    outline: none;
    background: #fbfaf8;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input:focus {
    border-color: var(--accent);
    background: #ffffff;
    box-shadow: 0 0 0 4px var(--accent-soft);
}

.legal-info-trigger {
    margin-top: 12px;
    display: flex;
    justify-content: center;
}

.info-legal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 4px;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 12.5px;
    font-weight: 500;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.info-legal-btn span:not(.info-legal-icon) {
    text-decoration: underline;
    text-decoration-style: dotted;
    text-underline-offset: 3px;
    text-decoration-color: #9ca3af;
}

.info-legal-btn:hover,
.info-legal-btn:focus-visible {
    color: var(--accent, #0c6c64);
    outline: none;
}

.info-legal-btn:hover span:not(.info-legal-icon),
.info-legal-btn:focus-visible span:not(.info-legal-icon) {
    text-decoration-color: var(--accent, #0c6c64);
}

.info-legal-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0c6c64 0%, #14897e 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(12, 108, 100, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-legal-btn:hover .info-legal-icon,
.info-legal-btn:focus-visible .info-legal-icon {
    transform: scale(1.08);
    box-shadow: 0 4px 10px rgba(12, 108, 100, 0.45);
}

.swal-legal-popup {
    border-radius: 16px !important;
    padding: 8px 6px 18px !important;
}

.swal-legal-title {
    color: #0c6c64 !important;
    font-size: 20px !important;
    font-weight: 700 !important;
}

.swal-legal-html {
    text-align: left !important;
    font-size: 14.5px !important;
    color: #374151 !important;
    line-height: 1.55 !important;
}

.swal-legal-html p {
    margin: 0 0 12px;
}

.swal-legal-html .legal-ley {
    background: #f5fbfa;
    border-left: 4px solid #0c6c64;
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13.5px;
}

.swal-legal-html .legal-derechos {
    margin: 0;
    padding-left: 18px;
}

.swal-legal-html .legal-derechos li {
    margin-bottom: 6px;
}

.swal-legal-confirm {
    background: #0c6c64 !important;
    border-radius: 10px !important;
    padding: 10px 22px !important;
    font-weight: 600 !important;
}

.submit {
    margin-top: 10px;
    padding: 13px 18px;
    border-radius: 12px;
    border: none;
    background: var(--accent);
    color: #ffffff;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(12, 108, 100, 0.25);
}

.note {
    margin: 10px 0 0;
    font-size: 12px;
    color: var(--muted);
    text-align: center;
}

.credits-footer {
    margin-top: 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.credits-footer .credit-line {
    margin: 0;
    color: var(--muted);
    line-height: 1.2;
    letter-spacing: 0.2px;
    text-align: center;
}

.credits-footer .credit-line:first-child {
    color: var(--ink);
    margin-bottom: 4px;
}

/* Cloudflare Turnstile Captcha */
.captcha-container {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px auto;
    text-align: center;
    width: 100%;
}

.captcha-container > div {
    margin: 0 auto;
    display: inline-block;
}

.captcha-container iframe {
    margin: 0 auto;
    display: block;
}

@media (max-width: 520px) {
    .row {
        grid-template-columns: 1fr;
    }

    .card {
        padding: 30px 22px 26px;
    }

    .page {
        padding: 15px 18px;
        min-height: auto;
    }

    h1 {
        font-size: 24px;
    }
}

/* ESTILOS PARA EVENTOS */
.eventos-section {
    margin: 12px 0 16px 0;
}

.eventos-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #fbfaf8;
    border-radius: 12px;
    border: 1px solid var(--line);
}

.eventos-loading {
    text-align: center;
    padding: 20px 10px;
    color: var(--muted);
    font-size: 14px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.event-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 14px;
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.event-checkbox:hover:not(.disabled) {
    border-color: var(--accent);
    background: #f9f9f9;
    box-shadow: 0 2px 8px rgba(12, 108, 100, 0.1);
}

.event-checkbox.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f5f5f5;
}

.event-checkbox.deseleccionado {
    border-color: #f59e0b;
    background: #fffbeb;
    animation: flash-deseleccion 1.5s ease-out;
}

@keyframes flash-deseleccion {
    0%   { background: #fef3c7; border-color: #f59e0b; }
    100% { background: #ffffff; border-color: var(--line); }
}

.event-checkbox input[type="checkbox"] {
    margin-top: 2px;
    cursor: pointer;
    width: 20px;
    height: 20px;
    accent-color: var(--accent);
    flex-shrink: 0;
}

.event-checkbox.disabled input[type="checkbox"] {
    cursor: not-allowed;
    opacity: 0.5;
}

.event-checkbox input:checked + .event-content {
    color: var(--accent);
}

.event-content {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    transition: color 0.2s ease;
}

.event-name {
    font-weight: 600;
    color: var(--ink);
    font-size: 14px;
    line-height: 1.3;
}

.event-checkbox input:checked + .event-content .event-name {
    color: var(--accent);
}

.event-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
}

.event-schedule {
    font-weight: 600;
    color: #0f766e;
}

.event-location {
    display: flex;
    align-items: center;
    gap: 4px;
}

.event-location::before {
    content: "📍";
    font-size: 12px;
}

.event-capacity {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: fit-content;
}

.event-capacity.available {
    background: #d4edda;
    color: #155724;
}

.event-capacity.full {
    background: #f8d7da;
    color: #721c24;
}

.event-checkbox input[type="checkbox"]:checked + .event-content .event-capacity.available {
    background: rgba(12, 108, 100, 0.2);
    color: var(--accent);
}


/* SELECTOR DE FECHAS */
.fechas-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.fecha-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 2px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
    user-select: none;
}

.fecha-btn:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.fecha-btn input[type="radio"] {
    accent-color: var(--accent);
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.fecha-btn.selected {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent);
}

/* Estado ya inscrito */
.event-checkbox.ya-inscrito {
    background: #f0fdf4;
    border-color: #86efac;
}

.event-checkbox.ya-inscrito .event-name {
    color: #15803d;
}

