/* Reset básico */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #FF0000 0%, #E60000 100%);
    min-height: 100vh;
    padding: 20px 0;
    /* Para móviles */
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px;
}

.form-wrapper {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: slideUp 0.6s ease-out;
}

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

/* Header */
.header {
    background: white;
    color: #333;
    text-align: center;
    padding: 40px 30px;
    position: relative;
    overflow: hidden;
}

.abb-logo {
    max-width: 200px;
    height: auto;
    margin-bottom: 20px;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
    z-index: 1;
    color: #333;
}

.description {
    font-size: 1.1rem;
    color: #666;
    font-weight: 300;
    margin-top: 15px;
    line-height: 1.5;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
    position: relative;
    z-index: 1;
}

/* Formulario */
.registration-form {
    padding: 40px 30px;
}

.section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

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

.section h2 {
    color: #FF0000;
    font-size: 1.4rem;
    font-weight: 600;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.section h2 i {
    font-size: 1.2rem;
}

/* Form Groups */
.form-group {
    margin-bottom: 25px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.95rem;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #fafbfc;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23667eea" stroke-width="2"><polyline points="6,9 12,15 18,9"/></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    appearance: none;
}

/* Radio buttons */
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 10px;
}

.radio-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-weight: 400;
    padding: 15px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    transition: all 0.3s ease;
    position: relative;
    background: #fafbfc;
}

.radio-label:hover {
    border-color: #FF0000;
    background-color: #fff5f5;
    transform: translateY(-1px);
}

.radio-label input[type="radio"] {
    display: none;
}

.radiomark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.radio-label input[type="radio"]:checked + .radiomark {
    background-color: #FF0000;
    border-color: #FF0000;
}

.radio-label input[type="radio"]:checked + .radiomark::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: white;
    transform: translate(-50%, -50%);
}

.radio-label input[type="radio"]:checked ~ * {
    color: #FF0000;
}

.radio-label small {
    display: block;
    color: #888;
    font-size: 0.85rem;
    margin-top: 2px;
    font-weight: 300;
}

.radio-label input[type="radio"]:checked ~ small {
    color: #FF0000;
}

/* Checkboxes */
.checkbox-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-weight: 400;
    padding: 10px;
    border-radius: 8px;
    transition: background-color 0.2s ease;
    position: relative;
}

.checkbox-label:hover {
    background-color: #f8f9fa;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 4px;
    margin-right: 12px;
    position: relative;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark {
    background-color: #FF0000;
    border-color: #FF0000;
}

.checkbox-label input[type="checkbox"]:checked + .checkmark::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.terms {
    background: #f8f9ff;
    border: 1px solid #e1e8ff;
    border-radius: 10px;
    padding: 15px;
    margin-top: 10px;
}

.terms a {
    color: #FF0000;
    text-decoration: none;
    font-weight: 500;
}

.terms a:hover {
    text-decoration: underline;
}

/* File Upload */
.file-upload {
    position: relative;
}

.file-upload input[type="file"] {
    display: none;
}

.file-upload-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    border: 2px dashed #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafbfc;
    text-align: center;
}

.file-upload-label:hover {
    border-color: #FF0000;
    background: #fff5f5;
}

.file-upload-label i {
    font-size: 2rem;
    color: #FF0000;
    margin-bottom: 10px;
}

.file-upload-label span {
    font-weight: 500;
    color: #555;
    margin-bottom: 5px;
}

.file-upload-label small {
    color: #888;
    font-size: 0.85rem;
}

/* Botones */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #FF0000 0%, #CC0000 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(255, 0, 0, 0.3);
}

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

.btn-secondary {
    background: #f8f9fa;
    color: #666;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

/* Mensajes de error */
.error-message {
    display: block;
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.form-group.error .error-message {
    opacity: 1;
}

/* Mensaje de éxito */
.success-message {
    padding: 40px 30px;
    text-align: center;
    animation: slideUp 0.6s ease-out;
}

.success-content {
    max-width: 400px;
    margin: 0 auto;
}

.success-content i {
    font-size: 4rem;
    color: #27ae60;
    margin-bottom: 20px;
}

.success-content h3 {
    color: #27ae60;
    font-size: 1.8rem;
    margin-bottom: 15px;
}

.success-content p {
    color: #666;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 0 15px;
    }
    
    .form-wrapper {
        border-radius: 15px;
        margin: 10px 0;
    }
    
    .header {
        padding: 30px 20px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .registration-form {
        padding: 30px 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .checkbox-group {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .form-actions {
        flex-direction: column-reverse;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px 0;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .registration-form {
        padding: 20px 15px;
    }
    
    .section h2 {
        font-size: 1.2rem;
    }
    
    /* Mejoras adicionales para móviles pequeños */
    input, select, textarea {
        font-size: 16px !important; /* Previene zoom en iOS */
        padding: 12px 15px;
    }
    
    .btn {
        padding: 15px 20px;
        font-size: 16px;
        min-height: 48px; /* Mejor área táctil */
    }
    
    .file-upload-area {
        padding: 20px 15px;
        min-height: 60px;
    }
}

/* Nueva media query para dispositivos muy pequeños */
@media (max-width: 360px) {
    .container {
        padding: 0 10px;
    }
    
    .form-wrapper {
        border-radius: 10px;
        margin: 5px 0;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.6rem;
        line-height: 1.2;
    }
    
    .registration-form {
        padding: 15px 10px;
    }
    
    .form-group {
        margin-bottom: 15px;
    }
    
    input, select, textarea {
        padding: 10px 12px;
    }
    
    .btn {
        padding: 12px 15px;
        font-size: 15px;
    }
}

/* Mejoras específicas para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        transform: none; /* Desactivar hover en dispositivos táctiles */
    }
    
    .btn:active {
        transform: scale(0.98);
        transition: transform 0.1s ease;
    }
    
    input:focus, select:focus, textarea:focus {
        outline: 2px solid #FF0000;
        outline-offset: 2px;
    }
}

/* Orientación landscape en móviles */
@media screen and (max-height: 500px) and (orientation: landscape) {
    body {
        padding: 5px 0;
    }
    
    .header {
        padding: 15px 20px;
    }
    
    .header h1 {
        font-size: 1.4rem;
    }
    
    .registration-form {
        padding: 15px 20px;
    }
}

/* Animaciones adicionales */
.form-group {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }
.form-group:nth-child(5) { animation-delay: 0.5s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de carga */
.btn.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
