/* ================================
   REGISTRO helppets - ESTILOS MEJORADOS
   ================================ */

:root {
    --primary-color: #10b981;
    --primary-hover: #059669;
    --secondary-color: #6b7280;
    --error-color: #ef4444;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --light-gray: #FAF8F4;
    --border-color: #d1d5db;
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-gray);
    color: var(--text-primary);
    line-height: 1.6;
}

/* Contenedor principal */
.register-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 20px;
    margin-top: 60px;
}

.register-card {
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    width: 100%;
    max-width: 700px;
    margin: 0 auto;
}

/* Header del registro */
.register-header {
    text-align: center;
    margin-bottom: 2rem;
}

.register-header h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.register-header p {
    font-size: 1rem;
    color: var(--text-secondary);
}

/* Barra de progreso - MÁS COMPACTA */
.progress-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    padding: 0 1rem;
}

.progress-bar.compact {
    margin-bottom: 1.5rem;
    padding: 0 0.5rem;
}

.progress-line {
    position: absolute;
    top: 16px;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 0%;
    z-index: 1;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 16px;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--border-color);
    border-radius: 2px;
    z-index: 0;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition);
    margin-bottom: 0.5rem;
}

.step.active .step-circle {
    background: var(--primary-color);
    color: var(--white);
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    max-width: 70px;
}

.step.active .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

/* Pasos del formulario */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.form-step.active {
    display: block;
}

/* Layout de formulario */
.form-row {
    display: flex;
    gap: 1rem;
    margin-bottom: 0;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group.half {
    flex: 1;
}

.form-group.third {
    flex: 1;
}

/* Labels e inputs */
.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: var(--transition);
    background: var(--white);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Texto de ayuda */
.help-text {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 0.25rem;
}

/* Info box para verificación de email */
.email-verification-info {
    background: linear-gradient(135deg, rgba(25, 118, 210, 0.08), rgba(25, 118, 210, 0.05));
    border-left: 4px solid #1976D2;
    border-radius: 8px;
    padding: 16px 20px;
    margin-top: 20px;
    display: flex;
    align-items: start;
    gap: 12px;
}

.email-verification-info .icon {
    font-size: 22px;
    flex-shrink: 0;
    margin-top: 2px;
}

.email-verification-info .content {
    flex: 1;
}

.email-verification-info .title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #1976D2;
    margin-bottom: 6px;
}

.email-verification-info .text {
    font-size: 0.85rem;
    color: #555;
    line-height: 1.5;
    margin-bottom: 8px;
}

.email-verification-info .spam-warning {
    font-size: 0.8rem;
    color: #e65100;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CONFIGURACIÓN - ESTILO ELEGANTE */
.config-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.section-desc {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.contribution-cards {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    align-items: flex-start; /* Importante: alinea al inicio para que no se ajusten en altura */
}

.contribution-card {
    flex: 1; /* Ocupa el espacio disponible pero mantiene altura independiente */
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    background: var(--white);
    transition: var(--transition);
    overflow: hidden;
}

.contribution-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

.contribution-card.selected {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.02);
}

.card-header {
    padding: 1.5rem 1rem 1rem;
}

.card-header input[type="checkbox"] {
    display: none;
}

.card-header label {
    cursor: pointer;
    display: block;
    text-align: center;
    margin-bottom: 0;
}

.card-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.card-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.card-content {
    padding: 0 1rem 1.5rem;
    border-top: 1px solid var(--light-gray);
    background: rgba(16, 185, 129, 0.02);
}

/* Animales - Nuevas tarjetas visuales con sistema desplegable */
.animal-category {
    margin-bottom: 1.5rem;
}

.animal-category-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0;
    padding: 1rem;
    background: var(--light-gray);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
    user-select: none;
}

.animal-category-title:hover {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.05);
}

.animal-category-title.active {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.collapse-icon {
    font-size: 0.875rem;
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}

.animal-category-title.active .collapse-icon {
    transform: rotate(180deg);
    color: var(--primary-color);
}

.collapsible-content {
    display: none;
    border: 2px solid var(--primary-color);
    border-top: none;
    border-bottom-left-radius: var(--radius-lg);
    border-bottom-right-radius: var(--radius-lg);
    padding: 1.5rem;
    background: var(--white);
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
    width: 100%;
    max-width: 100%;
}

.animal-card {
    position: relative;
    background: var(--white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
    width: 100%;
    min-width: 0; /* Permite que las tarjetas se encojan */
}

.animal-card:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.animal-card.selected {
    border-color: var(--primary-color);
    background: rgba(16, 185, 129, 0.1);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.animal-card input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.animal-card-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.5rem;
    cursor: pointer;
    margin-bottom: 0;
    height: 100%;
    min-height: 75px;
    gap: 0.25rem;
    transition: all 0.3s ease;
    text-align: center;
}

.animal-icon {
    font-size: 1.8rem;
    line-height: 1;
    margin-bottom: 0.125rem;
    display: block;
    transition: transform 0.3s ease;
}

.animal-card:hover .animal-icon {
    transform: scale(1.1);
}

.animal-card.selected .animal-icon {
    transform: scale(1.15);
}

.animal-name {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.1;
    transition: color 0.3s ease;
    word-break: break-word;
}

.animal-card.selected .animal-name {
    color: var(--primary-color);
    font-weight: 600;
}

.animal-requirement {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: var(--radius-sm);
    padding: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    color: #dc2626;
}

/* Campo "otros" mejorado */
.animal-category .form-group input[type="text"] {
    border: 2px dashed var(--border-color);
    background: rgba(107, 114, 128, 0.05);
    transition: all 0.3s ease;
}

.animal-category .form-group input[type="text"]:focus {
    border-color: var(--primary-color);
    border-style: solid;
    background: var(--white);
}

/* Animación de selección */
@keyframes animalCardSelect {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.animal-card.selected {
    animation: animalCardSelect 0.3s ease-once;
}

/* Responsive design para móviles */
@media (max-width: 768px) {
    .animal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .animal-card-label {
        padding: 0.75rem 0.5rem;
        min-height: 70px;
    }
    
    .animal-icon {
        font-size: 1.6rem;
    }
    
    .animal-name {
        font-size: 0.7rem;
    }
    
    .animal-category-title {
        font-size: 1rem;
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .animal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .animal-card-label {
        padding: 0.5rem 0.25rem;
        min-height: 65px;
    }
    
    .animal-icon {
        font-size: 1.4rem;
    }
    
    .animal-name {
        font-size: 0.65rem;
        line-height: 1;
    }
    
    .animal-category-title {
        font-size: 0.9rem;
        padding: 0.75rem;
    }
}

@media (min-width: 769px) {
    /* Asegurar 3 columnas exactas en desktop */
    .animal-grid {
        grid-template-columns: repeat(3, 1fr);
        max-width: 100%;
    }
    
    .animal-card {
        max-width: 100%;
    }
}
    .animal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .animal-card-label {
        padding: 1rem 0.5rem;
        min-height: 75px;
    }
    
    .animal-icon {
        font-size: 1.8rem;
    }
    
    .animal-name {
        font-size: 0.75rem;
    }
    
    .animal-category-title {
        font-size: 1rem;
        padding: 0.875rem;
    }
}

@media (max-width: 480px) {
    .animal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.6rem;
    }
    
    .animal-card-label {
        padding: 0.75rem 0.25rem;
        min-height: 70px;
    }
    
    .animal-icon {
        font-size: 1.6rem;
    }
    
    .animal-name {
        font-size: 0.7rem;
    }
}

/* Notificaciones */
.notifications-section {
    background: var(--light-gray);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-top: 2rem;
}

.notifications-section h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.notification-option {
    display: flex;
    align-items: flex-start;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: var(--white);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.notification-option:last-child {
    margin-bottom: 0;
}

.notification-option input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    accent-color: var(--primary-color);
}

.notification-option label {
    cursor: pointer;
    margin-bottom: 0;
}

.notification-option label strong {
    display: block;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
}

.notification-option label span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Seguridad */
.security-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

.checkbox-item.terms {
    display: flex;
    align-items: flex-start;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
}

.checkbox-item.terms input[type="checkbox"] {
    width: auto;
    margin-right: 0.75rem;
    margin-top: 0.1rem;
    accent-color: var(--primary-color);
}

.checkbox-item.terms label {
    cursor: pointer;
    margin-bottom: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.checkbox-item.terms a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

.checkbox-item.terms a:hover {
    text-decoration: underline;
}

/* reCAPTCHA */
.captcha-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--light-gray);
    border-radius: var(--radius-md);
}

/* Botones de navegación */
.form-navigation {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
}

.btn {
    padding: 0.875rem 2rem;
    border-radius: var(--radius-lg);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: 'Poppins', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
}

.btn-secondary {
    background: var(--white);
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.05);
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* Mensajes de error */
.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error-color);
}

.message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #2563eb;
    border-color: #2563eb;
}

/* Loading spinner */
.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid var(--white);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .register-container {
        padding: 1rem;
        margin-top: 80px;
    }
    
    .register-card {
        padding: 1.5rem;
    }

    .register-header h1 {
        font-size: 1.5rem;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .contribution-cards {
        grid-template-columns: 1fr;
    }
    
    .animal-types {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }

    .step-label {
        font-size: 0.7rem;
        max-width: 60px;
    }
    
    .step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .register-card {
        padding: 1rem;
    }
    
    .register-header h1 {
        font-size: 1.375rem;
    }
    
    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 0.875rem;
        padding: 0.625rem 0.875rem;
    }
    
    .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.875rem;
    }
    
    .step-circle {
        width: 24px;
        height: 24px;
        font-size: 0.7rem;
    }
    
    .step-label {
        font-size: 0.625rem;
        max-width: 60px;
        padding: 0 3px;
    }
    
    .progress-bar {
        padding: 0 0.5rem;
    }
}

/* Animaciones */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de focus mejorados */
.form-group input:focus-visible,
.form-group select:focus-visible,
.form-group textarea:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Mejoras de accesibilidad */
.contribution-card:focus-within,
.notification-option:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Autocompletado de dirección */
.pac-container {
    z-index: 9999 !important;
    border-radius: var(--radius-md) !important;
    box-shadow: var(--shadow-lg) !important;
}

.pac-item {
    padding: 0.75rem !important;
    border-bottom: 1px solid var(--border-color) !important;
    font-family: 'Poppins', sans-serif !important;
}

.pac-item:hover {
    background: var(--light-gray) !important;
}

.pac-matched {
    color: var(--primary-color) !important;
    font-weight: 600 !important;
}

/* Mensajes de error */
.error-message {
    color: var(--error-color);
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: none;
    font-weight: 500;
}

.form-group input.error,
.form-group select.error,
.form-group textarea.error {
    border-color: var(--error-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

/* Mensajes de estado */
.message {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    display: none;
    font-weight: 500;
    border-left: 4px solid;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-color: var(--success-color);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-color: var(--error-color);
}

/* ================================
   DISPONIBILIDAD SELECT MODERNO
   ================================ */

.custom-select-wrapper {
    position: relative;
    display: inline-block;
    width: 100%;
}

.custom-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    width: 100%;
    padding: 0.75rem 3rem 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    background-color: var(--white);
    background-image: none;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    cursor: pointer;
}

.custom-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.custom-select:hover {
    border-color: var(--primary-hover);
}

.custom-select option {
    padding: 0.5rem 1rem;
    font-weight: 500;
    background-color: var(--white);
    color: var(--text-primary);
}

.custom-select option:hover,
.custom-select option:checked {
    background-color: var(--primary-color);
    color: var(--white);
}

.select-arrow {
    position: absolute;
    top: 50%;
    right: 1rem;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--secondary-color);
    transition: var(--transition);
}

.custom-select:focus + .select-arrow {
    color: var(--primary-color);
    transform: translateY(-50%) rotate(180deg);
}

.disponibilidad-custom {
    margin-top: 1rem;
    padding: 1rem;
    background-color: rgba(16, 185, 129, 0.05);
    border: 2px dashed var(--primary-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.disponibilidad-custom textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 0.875rem;
    line-height: 1.5;
    resize: vertical;
    min-height: 80px;
    transition: var(--transition);
}

.disponibilidad-custom textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Animación para mostrar/ocultar */
.disponibilidad-custom {
    animation: slideDown 0.3s ease-in-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}