/**
 * Hoja de estilos principal del proyecto.
 * Implementación de los tokens de diseño indicados en color-guide.xml
 * Estética premium con glassmorphism sobre fondo halftone púrpura/durazno.
 */

/* ── Tokens de diseño (color-guide.xml) ── */
:root {
    --text-primary: #0F172A;
    --text-highlight: #FF5722;
    --text-highlight-dark: #D84315;
    --text-highlight-light: rgba(255, 87, 34, 0.08);
    --font-family: 'DM Sans', sans-serif;

    /* Paleta extendida armonizada con el fondo púrpura/durazno */
    --surface-glass: rgba(255, 255, 255, 0.72);
    --surface-glass-strong: rgba(255, 255, 255, 0.88);
    --surface-card: rgba(255, 255, 255, 0.92);
    --border-subtle: rgba(255, 255, 255, 0.45);
    --border-input: #d1d5db;
    --border-input-hover: #9ca3af;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 12px 40px rgba(15, 23, 42, 0.12);
    --shadow-glow: 0 0 60px rgba(255, 87, 34, 0.15);
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;
    --transition-fast: 0.18s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset y base ── */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    color: var(--text-primary);
    background: #b8a0d4 url('../../bg.webp') no-repeat center center fixed;
    background-size: cover;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    line-height: 1.6;
}

/* ── Contenedor raíz ── */
.wrapper {
    width: 100%;
    max-width: 860px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

/* Eliminado bloque original de cabecera porque se movió abajo */

.logo {
    max-width: 220px;
    height: auto;
    filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.15));
    transition: transform var(--transition-smooth);
}

.logo:hover {
    transform: scale(1.03);
}

/* ── Contenedor Principal (Tarjeta Glass) ── */
.main-container {
    background: var(--surface-glass-strong);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-xl);
    padding: 3rem 2.75rem;
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    animation: fadeSlideUp 0.6s var(--transition-smooth) both;
    animation-delay: 0.15s;
}

/* ── Tipografía Destacada ── */
.highlight {
    color: var(--text-highlight);
    font-weight: 700;
}

/* ── Sección Información del Evento ── */
.top-section {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.header {
    flex: 0 0 auto;
    margin-bottom: 0;
    max-width: 260px;
    animation: fadeSlideDown 0.7s var(--transition-smooth) both;
}

.event-info {
    flex: 1 1 300px;
}

.event-info h1 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

/* Tarjetas de datos del evento: Fecha / Hora / Lugar */
.event-meta {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 2rem;
}

.meta-card {
    background: var(--text-highlight-light);
    border: 1px solid rgba(255, 87, 34, 0.12);
    border-radius: var(--radius-md);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.meta-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.meta-icon {
    font-size: 1.35rem;
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.meta-content {
    display: flex;
    flex-direction: column;
}

.meta-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-highlight);
    margin-bottom: 0.15rem;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
}

/* ── Programa del Evento ── */
.program h2 {
    font-size: 1.3rem;
    margin-bottom: 1rem;
}

.program-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.program-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.06);
    transition: background var(--transition-fast);
}

.program-item:last-child {
    border-bottom: none;
}

.program-item:hover {
    background: var(--text-highlight-light);
    border-radius: var(--radius-sm);
    margin: 0 -0.5rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.program-bullet {
    width: 8px;
    height: 8px;
    min-width: 8px;
    border-radius: 50%;
    background: var(--text-highlight);
    margin-top: 0.5rem;
}

.program-text {
    font-size: 0.95rem;
    line-height: 1.5;
}

/* ── Formulario de Registro ── */
.registration-form {
    animation: fadeSlideUp 0.5s var(--transition-smooth) both;
    animation-delay: 0.3s;
}

.registration-form h2 {
    font-size: 1.6rem;
    margin-bottom: 0.35rem;
    letter-spacing: -0.01em;
}

.form-subtitle {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.25rem;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.form-row .form-group {
    margin-bottom: 0;
}

label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.required {
    color: var(--text-highlight);
    margin-left: 1px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--border-input);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-primary);
    background: #fff;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
    appearance: none;
    -webkit-appearance: none;
}

input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
    color: #9ca3af;
}

input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover,
select:hover {
    border-color: var(--border-input-hover);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus {
    outline: none;
    border-color: var(--text-highlight);
    box-shadow: 0 0 0 3px rgba(255, 87, 34, 0.1), var(--shadow-sm);
}

/* Flecha personalizada para selects */
select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%230F172A' viewBox='0 0 16 16'%3E%3Cpath d='M8 11.5l-5-5h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

/* ── Botón de Envío ── */
.btn-submit {
    display: block;
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--text-highlight), var(--text-highlight-dark));
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: all var(--transition-fast);
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.3);
}

.btn-submit::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(255, 255, 255, 0.2),
            transparent);
    transition: left 0.5s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
}

.btn-submit:hover::before {
    left: 100%;
}

.btn-submit:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(255, 87, 34, 0.3);
}

/* ── Alertas ── */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-sm);
    margin-bottom: 1.5rem;
    font-weight: 500;
    font-size: 0.9rem;
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    animation: fadeSlideDown 0.35s var(--transition-smooth) both;
}

.alert-icon {
    font-size: 1.15rem;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

.alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert.success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* ── Grupo Universidad (animado) ── */
#university_group {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.3s ease,
        margin 0.3s ease;
    margin-bottom: 0;
}

#university_group.visible {
    max-height: 120px;
    opacity: 1;
    margin-bottom: 1.25rem;
}

/* ── Campo Honeypot (invisible para humanos) ── */
.hp-field {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
}

/* ── Vista de Confirmación ── */
.success-container {
    text-align: center;
    padding: 2rem 1rem;
}

.success-icon-wrap {
    width: 80px;
    height: 80px;
    margin: 0 auto 1.5rem;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.3);
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.success-icon-wrap svg {
    width: 36px;
    height: 36px;
}

.success-container h1 {
    font-size: 1.8rem;
    color: var(--text-highlight);
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}

.success-container>p {
    color: #64748b;
    font-size: 0.95rem;
    max-width: 460px;
    margin: 0 auto 2.5rem;
    line-height: 1.6;
}

.event-reminder {
    background: var(--text-highlight-light);
    border: 1px solid rgba(255, 87, 34, 0.12);
    border-radius: var(--radius-md);
    padding: 2rem;
    text-align: left;
    margin-bottom: 2rem;
}

.event-reminder h2 {
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.event-reminder-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.event-reminder-row:last-child {
    margin-bottom: 0;
}

.event-reminder-row strong {
    min-width: 60px;
    color: #374151;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    background: linear-gradient(135deg, var(--text-highlight), var(--text-highlight-dark));
    color: #fff;
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all var(--transition-fast);
    box-shadow: 0 4px 14px rgba(255, 87, 34, 0.3);
}

.btn-back:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 87, 34, 0.4);
}

/* ── Footer ── */
.footer {
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.7);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    animation: fadeSlideUp 0.6s var(--transition-smooth) both;
    animation-delay: 0.4s;
}

.footer a {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.footer a:hover {
    color: #fff;
}

/* ── Animaciones ── */
@keyframes fadeSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeSlideDown {
    from {
        opacity: 0;
        transform: translateY(-12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* ── Responsive ── */
@media (max-width: 640px) {
    .wrapper {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    .main-container {
        padding: 2rem 1.5rem;
        border-radius: var(--radius-lg);
    }

    .event-info h1 {
        font-size: 1.6rem;
    }

    .event-meta {
        grid-template-columns: 1fr;
    }

    .form-row {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }

    .registration-form h2 {
        font-size: 1.35rem;
    }

    .logo {
        max-width: 170px;
    }

    .success-container h1 {
        font-size: 1.5rem;
    }

    .event-reminder {
        padding: 1.5rem 1.25rem;
    }
}

@media (max-width: 400px) {
    .main-container {
        padding: 1.5rem 1.15rem;
    }

    .event-info h1 {
        font-size: 1.35rem;
    }
}