/* Reset y Variables */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #D3A158;
    --primary-hover: #332005;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --text-dark: #1e293b;
    --text-light: #64748b;
    --border-color: #e2e8f0;
    --bg-light: #f8fafc;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --radius: 8px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #000000;
    min-height: 100vh;
    padding: 2rem 1rem;
    position: relative;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    animation: slideshow 24s infinite;
    opacity: 0.4;
}

@keyframes slideshow {
    0% {
        background-image: url('images/Entrenamiento-personalizado-scaled.webp');
        transform: scale(1);
    }
    25% {
        background-image: url('images/Entrenamiento-personalizado-scaled.webp');
        transform: scale(1.15);
    }
    33.33% {
        background-image: url('images/Inguz-Enfoque-integral-scaled.webp');
        transform: scale(1);
    }
    58.33% {
        background-image: url('images/Inguz-Enfoque-integral-scaled.webp');
        transform: scale(1.15);
    }
    66.66% {
        background-image: url('images/Instalaciones-Inguz-1080p.webp');
        transform: scale(1);
    }
    91.66% {
        background-image: url('images/Instalaciones-Inguz-1080p.webp');
        transform: scale(1.15);
    }
    100% {
        background-image: url('images/Instalaciones-Inguz-1080p.webp');
        transform: scale(1.15);
    }
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* Header */
header {
    background: #000000;
    color: var(--white);
    padding: 2.5rem 2rem;
}

.header-content {
    display: flex;
    align-items: center;
    gap: 2rem;
    max-width: 100%;
}

.header-logo {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    color: var(--white);
    filter: brightness(0) invert(1);
}

.header-text {
    flex: 1;
    text-align: left;
}

header h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.45rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Form Sections */
.form-section {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h2 {
    font-size: 1.5rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-section h2::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

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

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Por defecto, los campos inválidos NO se muestran en rojo */
input:invalid,
select:invalid,
textarea:invalid {
    border-color: var(--border-color);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(211, 161, 88, 0.1);
}

/* SOLO mostrar rojo después de intentar enviar (clase was-validated) */
form.was-validated input:invalid,
form.was-validated select:invalid,
form.was-validated textarea:invalid {
    border-color: var(--danger-color);
}

/* Checkbox Groups */
.checkbox-group {
    margin-bottom: 1rem;
}

.checkbox-group label {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
    font-weight: 400;
    margin-bottom: 0;
}

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

/* Consent Text */
.consent-text {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
}

.consent-text p {
    font-weight: 500;
    margin-bottom: 1rem;
    color: var(--text-dark);
}

.consent-text ul {
    list-style: none;
    padding: 0;
}

.consent-text li {
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
    position: relative;
    color: var(--text-light);
}

.consent-text li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--success-color);
    font-weight: bold;
}

/* Signature Section */
.signature-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#signatureCanvas {
    width: 100%;
    height: 200px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius);
    cursor: crosshair;
    background: var(--white);
    touch-action: none;
}

#signatureCanvas.has-signature {
    border-color: var(--success-color);
}

.signature-controls {
    display: flex;
    gap: 1rem;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:disabled {
    background: var(--secondary-color);
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--text-dark);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--bg-light);
    border-color: var(--text-dark);
}

.form-actions {
    padding: 2rem;
    background: var(--bg-light);
    display: flex;
    justify-content: center;
}

.form-actions .btn-primary {
    min-width: 250px;
}

/* Loading State */
.btn-primary.loading {
    position: relative;
    color: transparent;
}

.btn-primary.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

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

/* Success Message */
.success-message {
    background: var(--success-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 2rem;
    text-align: center;
    display: none;
}

.success-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

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

/* Error Message */
.error-message {
    background: var(--danger-color);
    color: var(--white);
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 2rem;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
    animation: slideDown 0.3s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem;
    }

    .container {
        border-radius: 0;
    }

    header {
        padding: 2rem 1.5rem;
    }

    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .header-logo {
        width: 60px;
        height: 60px;
    }

    .header-text {
        text-align: center;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .form-section {
        padding: 1.5rem;
    }

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

    .form-actions .btn-primary {
        min-width: 100%;
    }

    #signatureCanvas {
        height: 150px;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.25rem;
    }

    .form-section h2 {
        font-size: 1.25rem;
    }

    .form-section {
        padding: 1rem;
    }

    .form-actions {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .form-actions {
        display: none;
    }
}

/* (styles de calibración eliminados) */

