/*
 * Estilos Generales - Sistema Profesionales IML
 * Mobile-First, Touch-Friendly
 */

:root {
    --primary-color: #1e3a5f;
    --primary-light: #2d5a87;
    --secondary-color: #e85d04;
    --accent-color: #f48c06;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --light-bg: #f8fafc;
    --white: #ffffff;
    --text-dark: #1f2937;
    --text-muted: #6b7280;
    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.15);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-full: 50px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    color: var(--text-dark);
    -webkit-tap-highlight-color: transparent;
    -webkit-font-smoothing: antialiased;
}

/* ========== FORMULARIO CONTAINER ========== */
.form-page {
    background: var(--light-bg);
    min-height: 100vh;
}

.form-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    color: var(--white);
    padding: 1.5rem 1rem;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.form-header h1 {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.form-header p {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.3rem;
}

.form-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

@media (min-width: 768px) {
    .form-container {
        padding: 2rem;
    }
}

/* ========== CARD ========== */
.card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 1.5rem;
    overflow: hidden;
}

.card-body {
    padding: 1.25rem;
}

@media (min-width: 768px) {
    .card-body {
        padding: 2rem;
    }
}

/* ========== SECCIONES ========== */
.form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-title i {
    color: var(--secondary-color);
}

/* ========== INPUTS ========== */
.form-label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text-dark);
    margin-bottom: 0.4rem;
    display: block;
}

.form-label .required {
    color: var(--danger-color);
}

.form-control,
.form-select {
    width: 100%;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    font-size: 16px; /* Previene zoom en iOS */
    font-family: inherit;
    min-height: 50px;
    transition: var(--transition);
    background-color: var(--white);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.uppercase {
    text-transform: uppercase;
}

.form-control:read-only {
    background-color: var(--light-bg);
    cursor: not-allowed;
}

/* Input con ícono */
.input-icon {
    position: relative;
}

.input-icon i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-icon .form-control {
    padding-left: 2.75rem;
}

/* ========== SELECT ========== */
.form-select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%236b7280' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.form-select:disabled {
    background-color: var(--light-bg);
    cursor: not-allowed;
    opacity: 0.7;
}

/* ========== RADIO BUTTONS ========== */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.radio-btn {
    flex: 1;
    min-width: 120px;
}

.radio-btn input {
    display: none;
}

.radio-btn label {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1rem;
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 0.95rem;
    min-height: 50px;
    transition: var(--transition);
    gap: 0.5rem;
}

.radio-btn input:checked + label {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    border-color: var(--primary-color);
    color: var(--white);
    font-weight: 500;
}

.radio-btn label:hover {
    border-color: var(--primary-color);
}

/* ========== BOTÓN SUBMIT ========== */
.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1rem 2rem;
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--accent-color) 100%);
    color: var(--white);
    border: none;
    border-radius: var(--radius-full);
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    min-height: 56px;
    transition: var(--transition);
    box-shadow: 0 8px 20px rgba(232, 93, 4, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px rgba(232, 93, 4, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ========== ALERTAS ========== */
.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.alert-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-danger {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid #fde68a;
}

.alert i {
    font-size: 1.25rem;
    flex-shrink: 0;
}

/* ========== CAMPOS OCULTOS/CONDICIONALES ========== */
.hidden {
    display: none !important;
}

.field-group {
    margin-bottom: 1rem;
}

.field-group:last-child {
    margin-bottom: 0;
}

/* ========== TEXTAREA ========== */
textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

/* ========== FOOTER ========== */
.form-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.form-footer a {
    color: var(--primary-color);
    text-decoration: none;
}

/* ========== SUCCESS PAGE ========== */
.success-container {
    text-align: center;
    padding: 3rem 1.5rem;
}

.success-icon {
    font-size: 5rem;
    color: var(--success-color);
    margin-bottom: 1.5rem;
}

.success-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.success-message {
    font-size: 1.05rem;
    color: var(--text-muted);
    max-width: 400px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

/* ========== LOADING SPINNER ========== */
.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: var(--white);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ========== NOTA INFORMATIVA ========== */
.info-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

.required-note {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 575px) {
    .radio-btn {
        flex: 1 1 calc(50% - 0.375rem);
        min-width: auto;
    }
    
    .form-header h1 {
        font-size: 1.2rem;
    }
    
    .section-title {
        font-size: 1rem;
    }
}

/* ========== GRID ========== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: -0.5rem;
}

.col-12 { flex: 0 0 100%; max-width: 100%; padding: 0.5rem; }

@media (min-width: 576px) {
    .col-sm-6 { flex: 0 0 50%; max-width: 50%; }
}

@media (min-width: 768px) {
    .col-md-4 { flex: 0 0 33.333%; max-width: 33.333%; }
    .col-md-6 { flex: 0 0 50%; max-width: 50%; }
}

/* ========== ANIMACIONES ========== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease forwards;
}

/* ========== EDAD DISPLAY ========== */
.edad-display {
    background: var(--light-bg);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 0.75rem 1rem;
    min-height: 50px;
    display: flex;
    align-items: center;
    font-weight: 600;
    color: var(--primary-color);
}


.edad-display span {
    color: var(--text-muted);
    font-weight: 400;
    margin-left: 0.5rem;
}

/* ========== FOTO DE PERFIL - DISEÑO CUADRADO ========== */
.foto-upload-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem;
    background: linear-gradient(145deg, #f8fafc 0%, #eef2f7 100%);
    border-radius: var(--radius-lg);
    border: 2px dashed var(--border-color);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.foto-upload-wrapper:hover {
    border-color: var(--primary-light);
    background: linear-gradient(145deg, #f0f4f8 0%, #e8eef5 100%);
}

.foto-upload-wrapper.has-foto {
    border-style: solid;
    border-color: var(--success-color);
    background: linear-gradient(145deg, #f0fdf4 0%, #dcfce7 100%);
}

.foto-preview {
    width: 150px;
    height: 150px;
    border-radius: var(--radius-md);
    background: var(--white);
    border: 4px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.foto-upload-wrapper.has-foto .foto-preview {
    border-color: var(--success-color);
}

.foto-preview i {
    font-size: 3.5rem;
    color: #d1d5db;
}

.foto-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.foto-upload-text {
    margin-top: 1rem;
    text-align: center;
}

.foto-upload-text .main-text {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

.foto-upload-text .sub-text {
    color: var(--text-muted);
    font-size: 0.8rem;
    margin-top: 4px;
}

.foto-upload-text .optional-badge {
    display: inline-block;
    background: var(--warning-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 10px;
    font-weight: 500;
    margin-left: 6px;
}

.foto-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.foto-remove-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--danger-color);
    color: white;
    border: none;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: var(--transition);
    z-index: 5;
}

.foto-remove-btn:hover {
    background: #dc2626;
    transform: scale(1.1);
}

.foto-upload-wrapper.has-foto .foto-remove-btn {
    display: flex;
}

/* Responsive foto */
@media (min-width: 768px) {
    .foto-preview {
        width: 160px;
        height: 160px;
    }
    
    .foto-preview i {
        font-size: 4rem;
    }
}

@media (max-width: 576px) {
    .foto-upload-wrapper {
        padding: 1rem;
    }
    
    .foto-preview {
        width: 120px;
        height: 120px;
    }
    
    .foto-preview i {
        font-size: 3rem;
    }
    
    .foto-upload-text .main-text {
        font-size: 0.85rem;
    }
}

/* ========== DATOS PERSONALES CON FOTO ========== */
.datos-personales-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .datos-personales-grid {
        grid-template-columns: auto 1fr;
        gap: 2rem;
    }
    
    .datos-personales-grid .foto-column {
        width: 200px;
    }
}

.datos-personales-grid .campos-column {
    width: 100%;
}

