:root {
    /* Identidad FEN/UChile - Azul + Morado */
    --primary: #003366;
    --primary-glow: rgba(0, 51, 102, 0.4);
    --secondary: #004080;
    --accent: #7c3aed;
    --accent-glow: rgba(124, 58, 237, 0.4);
    --bg-dark: #0a1628;
    --bg-card: rgba(15, 35, 60, 0.85);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border: rgba(255, 255, 255, 0.08);
    --success: #00674F;
    --error: #c53030;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
    padding: max(2rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(3rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

/* Dynamic Animated Background */
.background-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    min-height: 100vh;
    height: 100%;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    animation: float 20s infinite ease-in-out alternate;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: #003366;
    top: -100px;
    left: -100px;
    opacity: 0.35;
}

.shape-2 {
    width: 500px;
    height: 500px;
    background: var(--accent);
    bottom: -150px;
    right: -100px;
    opacity: 0.2;
    animation-delay: -5s;
}

@keyframes float {
    0% {
        transform: translate(0, 0) scale(1);
    }

    100% {
        transform: translate(50px, 50px) scale(1.1);
    }
}

/* Main Container (Glassmorphism) */
.container {
    background: var(--bg-card);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 3rem;
    width: 100%;
    max-width: 550px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: translateY(20px);
    opacity: 0;
    animation: slideUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    margin: 0 auto;
}

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

header {
    text-align: center;
    margin-bottom: 2.5rem;
}

/* Formularios de reserva (individual + grupal) — layout compacto */
body.page-reserva .container {
    padding: 2rem 2rem 2.25rem;
    max-width: 620px;
}

body.page-reserva header {
    margin-bottom: 1.35rem;
}

body.page-reserva header h1 {
    font-size: 2rem;
    margin-bottom: 0.35rem;
}

body.page-reserva header p {
    font-size: 0.95rem;
    margin-bottom: 0.65rem;
    line-height: 1.4;
}

body.page-reserva .nav-link {
    margin-bottom: 0.5rem;
    padding: 0.55rem 1rem;
    min-height: 40px;
    font-size: 0.92rem;
}

body.page-reserva .link-disponibilidad {
    margin: 0.65rem 0 0.85rem;
    padding: 0.75rem 1.1rem;
    min-height: 42px;
    font-size: 1rem;
}

body.page-reserva #bookingForm .form-row {
    gap: 0.6rem;
    margin-bottom: 0;
}

body.page-reserva #bookingForm .input-group {
    margin-bottom: 0.7rem;
}

body.page-reserva #bookingForm label {
    margin-bottom: 0.3rem;
    font-size: 0.95rem;
    font-weight: 500;
}

body.page-reserva #bookingForm textarea,
body.page-reserva #bookingForm input {
    padding: 0.62rem 0.75rem;
    font-size: 0.92rem;
    border-radius: 10px;
}

body.page-reserva #bookingForm textarea {
    min-height: 4.5rem;
    resize: vertical;
}

body.page-reserva #bookingForm .hint {
    margin-top: 0.2rem;
    font-size: 0.76rem;
    line-height: 1.35;
}

body.page-reserva #bookingForm .hint-block {
    margin: -0.15rem 0 0.55rem;
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-muted);
}

body.page-reserva #bookingForm .field-error {
    margin-top: 0.15rem;
    font-size: 0.78rem;
}

body.page-reserva #bookingForm .form-errors-row {
    display: block;
    margin-bottom: 0.35rem;
}

body.page-reserva #bookingForm button[type="submit"] {
    margin-top: 0.35rem;
    padding: 0.85rem 1rem;
    font-size: 1rem;
}

body.page-reserva .response-banner {
    margin-top: 1rem;
    padding: 0.9rem 1rem;
}

body.page-reserva .upload-integrantes .file-input-label {
    min-height: 40px;
    padding: 0.65rem 1rem;
    margin-top: 0.35rem;
    font-size: 0.92rem;
}

body.page-reserva .upload-integrantes .btn-thin {
    margin-top: 0.35rem;
    min-height: 34px;
    padding: 0.45rem 0.85rem;
    font-size: 0.88rem;
}

body.page-reserva .integrantes-preview {
    margin-top: 0.45rem;
    padding: 0.5rem 0.65rem;
    font-size: 0.82rem;
}

body.page-reserva .upload-integrantes > label[for="excelIntegrantes"] {
    width: 100%;
    margin-bottom: 0.25rem;
}

body.page-reserva .excel-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

body.page-reserva .btn-excel-action,
body.page-reserva .upload-integrantes .file-input-label.btn-excel-action {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 0;
    min-height: 42px;
    padding: 0.65rem 1rem;
    background: rgba(0, 51, 102, 0.2);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.92rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

body.page-reserva .btn-excel-action:hover,
body.page-reserva .upload-integrantes .file-input-label.btn-excel-action:hover {
    background: rgba(0, 51, 102, 0.35);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.01);
}

@media (max-width: 520px) {
    body.page-reserva .container {
        padding: 1.5rem 1.25rem 1.75rem;
    }

    body.page-reserva #bookingForm .form-row {
        grid-template-columns: 1fr;
    }
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.highlight {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.5;
}

.nav-link, .btn-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.25rem;
    margin: 0.25rem 0;
    min-height: 44px;
    background: rgba(0, 51, 102, 0.2);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.2s ease;
    font-family: inherit;
}
.nav-link:hover, .btn-link:hover {
    background: rgba(0, 51, 102, 0.35);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.02);
}

.link-disponibilidad {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 1.25rem 0;
    padding: 1rem 1.5rem;
    min-height: 48px;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.25), rgba(124, 58, 237, 0.2));
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 1.1rem;
    transition: all 0.2s ease;
}
.link-disponibilidad:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.35), rgba(124, 58, 237, 0.3));
    transform: scale(1.02);
}

/* Botón delgado full-width (ej. descargar plantilla Excel) */
.btn-thin {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.5rem 1rem;
    min-height: 36px;
    background: rgba(0, 51, 102, 0.2);
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    font-family: inherit;
    margin-top: 0.5rem;
}
.btn-thin:hover {
    background: rgba(0, 51, 102, 0.35);
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.01);
}

/* Iconos (siluetas en código, sin emojis) */
.icon-svg {
    display: inline-block;
    vertical-align: middle;
    fill: none;
    stroke: currentColor;
    color: inherit;
}
.icon-svg.icon-sm { width: 1em; height: 1em; margin-right: 0.35rem; }
.icon-svg.icon-md { width: 1.25em; height: 1.25em; margin-right: 0.4rem; }
.icon-svg.icon-lg { width: 2rem; height: 2rem; margin-bottom: 0.25rem; }
.landing-card .icon-wrap { display: block; margin-bottom: 0.5rem; color: var(--text-main); }
.landing-card .icon-wrap .icon-svg { display: block; margin: 0 auto; }

/* Form Styles */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-row:has(> *:nth-child(3)) {
    grid-template-columns: 2fr 1fr 1fr;
}

.input-group {
    margin-bottom: 1.5rem;
}

label .required {
    color: var(--error);
}

label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    font-size: 1.1rem;
    color: var(--text-main);
}

textarea,
input {
    width: 100%;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1rem;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
}

textarea {
    resize: vertical;
}

textarea:focus,
input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-glow);
}

textarea::placeholder,
input::placeholder {
    color: #475569;
}

input[type="time"],
input[type="date"] {
    color-scheme: dark;
}

.hint {
    margin-top: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.field-error {
    display: none;
    margin-top: 0.35rem;
    font-size: 0.85rem;
    color: var(--error);
}

/* Button */
button {
    width: 100%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border: none;
    border-radius: 12px;
    padding: 1rem;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 14px 0 var(--primary-glow);
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(124, 58, 237, 0.4);
}

button:active {
    transform: translateY(0);
}

button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Messages */
.message {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    line-height: 1.5;
    animation: fadeIn 0.4s ease forwards;
}

.hidden {
    display: none !important;
}

.message.hidden {
    display: none;
}

.message.success {
    background: rgba(0, 103, 79, 0.15);
    border: 1px solid var(--success);
    color: #2dd4a8;
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: #f87171;
}

.message.warning {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid #eab308;
    color: #fde047;
}

/* Banner de respuesta (rechazo/aprobación/error) - muy visible */
.response-banner {
    margin-top: 1.5rem;
    padding: 1.25rem 1.5rem;
    border-radius: 12px;
    font-size: 1rem;
    line-height: 1.6;
    border-left: 4px solid;
    animation: fadeIn 0.4s ease forwards;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.response-banner.hidden {
    display: none !important;
}

.response-banner[data-type="success"] {
    background: rgba(0, 103, 79, 0.2);
    border-left-color: var(--success);
    color: #2dd4a8;
}

.response-banner[data-type="error"] {
    background: rgba(197, 48, 48, 0.2);
    border-left-color: var(--error);
    color: #fca5a5;
}

.response-banner[data-type="warning"] {
    background: rgba(234, 179, 8, 0.2);
    border-left-color: #eab308;
    color: #fde047;
}

.response-banner strong {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 1.05rem;
}

.response-banner small {
    opacity: 0.9;
    font-size: 0.9rem;
}

.correo-nota {
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.disp-result {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.95rem;
    font-weight: 500;
}

.disp-result.hidden {
    display: none;
}

.disp-result.disp-ok {
    color: var(--success);
}

.disp-result.disp-no {
    color: var(--error);
}

button.btn-secondary {
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.2), rgba(124, 58, 237, 0.15));
    border: 2px solid var(--primary);
    color: var(--text-main);
    box-shadow: none;
}

button.btn-secondary:hover:not(:disabled) {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.3), rgba(124, 58, 237, 0.25));
}

button.btn-verificar {
    padding: 0.85rem 1.25rem;
    font-size: 1rem;
    min-height: 48px;
}

button.btn-retry {
    width: auto;
    padding: 0.4rem 1rem;
    margin-top: 0.5rem;
}

.integrantes-preview {
    margin-top: 0.75rem;
    padding: 0.75rem;
    background: rgba(0, 51, 102, 0.15);
    border: 1px solid var(--border);
    border-radius: 10px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.upload-integrantes .file-input-label {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.25), rgba(124, 58, 237, 0.2));
    border: 2px solid var(--primary);
    border-radius: 12px;
    color: var(--text-main);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.upload-integrantes .file-input-label:hover {
    border-color: var(--accent);
    background: linear-gradient(135deg, rgba(0, 51, 102, 0.35), rgba(124, 58, 237, 0.3));
    transform: scale(1.01);
}

.upload-integrantes .file-input-label input[type="file"] {
    position: absolute;
    width: 0.1px;
    height: 0.1px;
    opacity: 0;
    overflow: hidden;
    z-index: -1;
}

.upload-integrantes .file-input-text {
    pointer-events: none;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

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

/* Responsive */
@media (max-width: 600px) {
    body {
        padding: 1rem 0.75rem 2rem;
    }

    .container {
        padding: 1.5rem 1.25rem;
        margin: 0 0.5rem;
        border-radius: 20px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .form-row,
    .form-row:has(> *:nth-child(3)) {
        grid-template-columns: 1fr;
    }

    .link-disponibilidad {
        padding: 1rem;
        font-size: 1rem;
        min-height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
}