/**
 * Estilos modernos para el formulario de registro
 * Diseño responsive y visualmente atractivo
 * 
 * @package Costa_Rica_Registration
 */

/* Variables CSS */
:root {
    --cr-primary-color: #0d6efd;
    --cr-primary-dark: #0a58ca;
    --cr-secondary-color: #6c757d;
    --cr-success-color: #198754;
    --cr-danger-color: #dc3545;
    --cr-warning-color: #ffc107;
    --cr-info-color: #0dcaf0;
    --cr-dark-color: #212529;
    --cr-light-color: #f8f9fa;
    --cr-border-color: #dee2e6;
    --cr-border-radius: 12px;
    --cr-shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --cr-shadow-md: 0 4px 12px rgba(0,0,0,0.15);
    --cr-shadow-lg: 0 8px 24px rgba(0,0,0,0.2);
    --cr-transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Contenedor Principal */
.cr-registration-container {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.cr-registration-wrapper {
    background: #ffffff;
    border-radius: var(--cr-border-radius);
    box-shadow: var(--cr-shadow-lg);
    overflow: hidden;
}

/* Header */
.cr-registration-header {
    background: linear-gradient(135deg, var(--cr-primary-color) 0%, var(--cr-primary-dark) 100%);
    color: white;
    padding: 3rem 2rem;
    text-align: center;
}

.cr-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: white !important; /* Forzar color blanco para evitar sobrescritura de estilos del tema */
    text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.cr-subtitle {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.95;
}

/* Secciones del Formulario */
.cr-form-section {
    padding: 2.5rem;
    border-bottom: 1px solid var(--cr-border-color);
}

.cr-form-section:last-child {
    border-bottom: none;
}

.cr-section-header {
    margin-bottom: 2rem;
}

.cr-section-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--cr-dark-color);
    margin: 0 0 1rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.cr-icon {
    font-size: 1.5rem;
}

.cr-section-line {
    height: 3px;
    width: 60px;
    background: linear-gradient(90deg, var(--cr-primary-color), var(--cr-primary-dark));
    border-radius: 2px;
}

/* Grid del Formulario */
.cr-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.cr-form-group {
    display: flex;
    flex-direction: column;
}

.cr-form-group.cr-full-width {
    grid-column: 1 / -1;
}

.cr-form-group.cr-span-2 {
    grid-column: span 2;
}

/* Labels */
.cr-label {
    font-weight: 600;
    color: var(--cr-dark-color);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.cr-required {
    color: var(--cr-danger-color);
}

.cr-label-hint {
    font-weight: 400;
    color: var(--cr-secondary-color);
    font-size: 0.85rem;
}

/* Inputs */
.cr-input,
.cr-select {
    padding: 0.875rem 1rem;
    border: 2px solid var(--cr-border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: var(--cr-transition);
    background: #ffffff;
}

.cr-input:focus,
.cr-select:focus {
    outline: none;
    border-color: var(--cr-primary-color);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.cr-input:read-only {
    background: var(--cr-light-color);
    cursor: not-allowed;
}

/* File Upload */
.cr-file-upload {
    position: relative;
}

.cr-file-input {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.cr-file-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px dashed var(--cr-border-color);
    border-radius: 8px;
    background: var(--cr-light-color);
    cursor: pointer;
    transition: var(--cr-transition);
}

.cr-file-label:hover {
    border-color: var(--cr-primary-color);
    background: rgba(13, 110, 253, 0.05);
}

.cr-file-icon {
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--cr-primary-color);
}

.cr-file-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

/* Tarjetas de Asistentes */
.cr-attendee-card {
    background: var(--cr-light-color);
    border: 2px solid var(--cr-border-color);
    border-radius: var(--cr-border-radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: var(--cr-transition);
}

.cr-attendee-card:hover {
    box-shadow: var(--cr-shadow-md);
    border-color: var(--cr-primary-color);
}

.cr-attendee-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--cr-border-color);
}

.cr-attendee-number {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--cr-primary-color);
    margin: 0;
}

.cr-btn-remove-attendee {
    background: var(--cr-danger-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--cr-transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cr-btn-remove-attendee:hover {
    background: #bb2d3b;
    transform: scale(1.1);
}

/* Opciones de Radio (Patrocinio y Pago) */
.cr-sponsorship-grid,
.cr-payment-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.cr-radio-option {
    display: block;
    cursor: pointer;
    padding: 1rem;
    border: 2px solid var(--cr-border-color);
    border-radius: 8px;
    transition: var(--cr-transition);
    background: #ffffff;
}

.cr-radio-option:hover {
    border-color: var(--cr-primary-color);
    box-shadow: var(--cr-shadow-sm);
}

.cr-radio-option input[type="radio"] {
    display: none;
}

.cr-radio-option input[type="radio"]:checked + .cr-radio-label {
    color: var(--cr-primary-color);
}

.cr-radio-option input[type="radio"]:checked ~ *,
.cr-radio-option input[type="radio"]:checked + .cr-radio-label {
    border-color: var(--cr-primary-color);
}

.cr-radio-option:has(input[type="radio"]:checked) {
    border-color: var(--cr-primary-color);
    background: rgba(13, 110, 253, 0.05);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

.cr-radio-label {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cr-price {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--cr-primary-color);
}

.cr-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.cr-badge-available {
    background: rgba(13, 110, 253, 0.1);
    color: var(--cr-primary-color);
}

.cr-badge-soldout {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.cr-badge-low {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.cr-discount-info {
    margin-top: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: rgba(25, 135, 84, 0.1);
    border-left: 3px solid #198754;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #157347;
    font-weight: 500;
    line-height: 1.3;
}

.cr-discount-info strong {
    display: block;
    margin-bottom: 0.2rem;
    font-size: 0.8rem;
    font-weight: 600;
}

.cr-radio-disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cr-radio-disabled:hover {
    border-color: var(--cr-border-color);
    box-shadow: none;
}

.cr-radio-disabled .cr-radio-label {
    cursor: not-allowed;
}

.cr-sponsorship-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: rgba(13, 110, 253, 0.05);
    border: 1px solid var(--cr-primary-color);
    border-radius: 8px;
    color: var(--cr-primary-dark);
}

.cr-sponsorship-note p {
    margin: 0.5rem 0;
    line-height: 1.6;
}

.cr-sponsorship-note p:first-child {
    margin-top: 0;
}

.cr-sponsorship-note p:last-child {
    margin-bottom: 0;
}

.cr-sponsorship-note a {
    color: #198754;
    text-decoration: underline;
}

.cr-sponsorship-note a:hover {
    color: #157347;
}

.cr-payment-option {
    min-height: 80px;
    display: flex;
    align-items: center;
}

.cr-payment-icon {
    font-size: 1.5rem;
}

/* Checkbox */
.cr-checkbox-group {
    padding: 1rem;
    background: var(--cr-light-color);
    border-radius: 8px;
}

.cr-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.cr-checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

/* Botones */
.cr-form-actions {
    padding: 2rem;
    text-align: center;
    background: var(--cr-light-color);
}

.cr-btn {
    padding: 1rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--cr-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}

.cr-btn-primary {
    background: linear-gradient(135deg, var(--cr-primary-color) 0%, var(--cr-primary-dark) 100%);
    color: white;
    box-shadow: var(--cr-shadow-md);
}

.cr-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--cr-shadow-lg);
}

.cr-btn-secondary {
    background: #ffffff;
    color: var(--cr-primary-color);
    border: 2px solid var(--cr-primary-color);
}

.cr-btn-secondary:hover {
    background: var(--cr-primary-color);
    color: white;
}

.cr-btn-large {
    padding: 1.25rem 3rem;
    font-size: 1.2rem;
}

.cr-loading-spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Mensajes de Error/Success */
.cr-error,
.cr-success {
    padding: 1rem 1.5rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.cr-error {
    background: rgba(220, 53, 69, 0.1);
    color: var(--cr-danger-color);
    border: 2px solid var(--cr-danger-color);
}

.cr-success {
    background: rgba(25, 135, 84, 0.1);
    color: var(--cr-success-color);
    border: 2px solid var(--cr-success-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    .cr-registration-container {
        margin: 1rem auto;
        padding: 0 0.5rem;
    }

    .cr-registration-header {
        padding: 2rem 1rem;
    }

    .cr-title {
        font-size: 2rem;
        color: white !important; /* Mantener color blanco en responsive */
    }

    .cr-form-section {
        padding: 1.5rem;
    }

    .cr-form-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .cr-form-group.cr-span-2 {
        grid-column: 1;
    }

    .cr-sponsorship-grid,
    .cr-payment-options {
        grid-template-columns: 1fr;
    }

    .cr-btn-large {
        padding: 1rem 2rem;
        font-size: 1rem;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cr-title {
        font-size: 1.75rem;
        color: white !important; /* Mantener color blanco en responsive */
    }

    .cr-section-title {
        font-size: 1.5rem;
    }

    .cr-form-section {
        padding: 1rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cr-attendee-card {
    animation: fadeIn 0.3s ease-out;
}

/* Accesibilidad */
.cr-input:focus,
.cr-select:focus,
.cr-btn:focus {
    outline: 3px solid rgba(13, 110, 253, 0.3);
    outline-offset: 2px;
}

/* Campos ocultos para companions */
.cr-companion-hidden {
    display: none !important;
}

/* Print Styles */
@media print {
    .cr-registration-container {
        box-shadow: none;
    }

    .cr-form-actions {
        display: none;
    }
}
