/* ============ RESET Y BASE ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    overflow-x: hidden;
    color: #2d3748;
}

/* ============ HEADER (mismo del index) ============ */
.header {
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    padding: 12px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    border-bottom: 4px solid #7cc4d6;
    background: linear-gradient(to right, #7cc4d6 0%, transparent 10%, transparent 90%, #7cc4d6 100%), color-mix(in srgb, #7cc4d6 25%, #ffffff);
}

.header-container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
}

.logo {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    background: white;
}

.logo-text h1 {
    color: #2d3748;
    font-size: 20px;
    font-weight: 700;
    line-height: 1.2;
}

.logo-text h2 {
    color: #667eea;
    font-size: 15px;
    font-weight: 600;
    margin-top: 2px;
}

.nav-menu {
    display: flex;
    gap: 5px;
    list-style: none;
    text-shadow: #4e4e4e 2px 2px 20px;
}

.nav-menu li a {
    color: #e93f3f;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    padding: 12px 20px;
    position: relative;
    display: inline-block;
    transition: color 0.3s ease;
    cursor: pointer;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: #e53e3e;
    border-radius: 2px;
    transition: width 0.3s ease;
    box-shadow: 0 2px 6px rgb(238, 255, 4);
}

.nav-menu li a:hover::after,
.nav-menu li a:focus::after,
.nav-menu li a:active::after {
    width: 80%;
}

.nav-menu li a:hover,
.nav-menu li a:focus,
.nav-menu li a:active {
    color: #fbff00;
    text-shadow: #000000 1px 2px 8px;
}

/* ============ CONTENEDOR PRINCIPAL ============ */
.main-form-container {
    margin-top: 80px;
    padding: 15px;
    max-width: 1300px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
    z-index: 2;
}

/* Mantiene el pie al borde inferior en páginas de contenido corto. */
body.page-consultar {
    display: flex;
    flex-direction: column;
}

body.page-consultar .main-form-container {
    flex: 1;
    width: 100%;
    max-width: 1000px;
    box-sizing: border-box;
}

/* ============ TÍTULO DEL FORMULARIO ============ */
.form-title-section {
    text-align: center;
    color: white;
    margin-bottom: 20px;
}

.form-title-section h2 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.form-title-section p {
    font-size: 16px;
    opacity: 0.95;
}

/* ============ CARD DEL FORMULARIO ============ */
.form-card {
    background: white;
    border-radius: 20px;
    /*margin-top: 200px;*/
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    animation: fadeIn 0.8s ease;
}

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

/* ============ SECCIONES DEL FORMULARIO ============ */
.form-section {
    margin-bottom: 35px;
    padding-bottom: 30px;
    border-bottom: 2px dashed #e2e8f0;
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: white;
}

.section-header .section-icon {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255,255,255,0.3);
    flex-shrink: 0;
}

.section-header h3 {
    font-size: 20px;
    font-weight: 600;
}

.section-header p {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 3px;
}

/* ============ GRID DE CAMPOS ============ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

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

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

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-group label .required {
    color: #e53e3e;
    font-size: 16px;
}

.form-group label i {
    color: #667eea;
    font-size: 14px;
}

/* ============ INPUTS, SELECTS, TEXTAREAS ============ */
.form-control {
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.3s ease;
    background: #f7fafc;
    color: #2d3748;
}

.form-control:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
}

.form-control:hover {
    border-color: #cbd5e0;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

select.form-control {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23667eea' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px;
    padding-right: 40px;
}

/* ============ RADIO Y CHECKBOX ============ */
.radio-group {
    display: flex;
    gap: 20px;
    padding: 10px 0;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

.radio-option:hover {
    border-color: #667eea;
    background: #edf2ff;
}

.radio-option input[type="radio"] {
    accent-color: #667eea;
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.radio-option input[type="radio"]:checked + span {
    color: #667eea;
    font-weight: 600;
}

.radio-option:has(input:checked) {
    border-color: #667eea;
    background: #edf2ff;
}

/* ============ FILE UPLOAD ============ */
.file-upload-area {
    border: 2px dashed #cbd5e0;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.3s ease;
    background: #f7fafc;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: #667eea;
    background: #edf2ff;
}

.file-upload-area.dragover {
    border-color: #667eea;
    background: #edf2ff;
    transform: scale(1.02);
}

.file-upload-area i {
    font-size: 40px;
    color: #667eea;
    margin-bottom: 10px;
}

.file-upload-area p {
    color: #4a5568;
    font-size: 14px;
    margin-bottom: 5px;
}

.file-upload-area small {
    color: #718096;
    font-size: 12px;
}

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

/* Lista de archivos anexos */
.anexos-list {
    margin-top: 15px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.anexo-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 10px;
    border-left: 4px solid #0ea5e9;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.anexo-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.anexo-info i {
    font-size: 22px;
    color: #0ea5e9;
}

.anexo-details {
    display: flex;
    flex-direction: column;
}

.anexo-name {
    font-size: 14px;
    font-weight: 600;
    color: #0c4a6e;
    word-break: break-all;
}

.anexo-size {
    font-size: 12px;
    color: #64748b;
}

.anexo-remove {
    background: #fee2e2;
    color: #dc2626;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.anexo-remove:hover {
    background: #dc2626;
    color: white;
    transform: scale(1.1);
}

/* ============ CAPTCHA ============ */
.captcha-section {
    background: linear-gradient(135deg, #fef5e7 0%, #fef3c7 100%);
    border: 2px solid #f59e0b;
    border-radius: 12px;
    padding: 20px;
    margin: 25px 0;
}

.captcha-section h4 {
    color: #78350f;
    font-size: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.captcha-container {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.captcha-image {
    background: white;
    padding: 5px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.captcha-image img {
    display: block;
    border-radius: 5px;
}

.captcha-refresh {
    background: #f59e0b;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.captcha-refresh:hover {
    background: #d97706;
    transform: rotate(180deg);
}

.captcha-input {
    flex: 1;
    min-width: 150px;
}

/* ============ BOTONES ============ */
.form-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    flex-wrap: wrap;
}

.btn {
    padding: 14px 35px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: inherit;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.5);
}

.btn-secondary {
    background: #e2e8f0;
    color: #2d3748;
}

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

.btn-danger {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    box-shadow: 0 10px 30px rgba(229, 62, 62, 0.3);
}

.btn-danger:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(229, 62, 62, 0.4);
}

/* ============ ALERTAS ============ */
.alert {
    padding: 15px 20px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #dcfce7 100%);
    color: #166534;
    border-left: 4px solid #22c55e;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border-left: 4px solid #ef4444;
}

.alert-info {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    color: #0c4a6e;
    border-left: 4px solid #0ea5e9;
}

.alert-warning {
    background: linear-gradient(135deg, #fef5e7 0%, #fef3c7 100%);
    color: #78350f;
    border-left: 4px solid #f59e0b;
}

.alert i {
    font-size: 20px;
}

/* ============ FOOTER ============ */
.footer {
    background: rgba(0,0,0,0.3);
    color: white;
    padding: 12px 0;
    text-align: center;
    font-size: 14px;
    backdrop-filter: blur(10px);
    margin-top: 40px;
    position: relative;
    z-index: 2;
}

.footer p { margin: 3px 0; }
.footer .copyright { opacity: 0.8; font-size: 13px; }

/* ============ PARTÍCULAS ============ */
.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
}

.particle {
    position: absolute;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    animation: float 15s infinite linear;
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.6),
                0 0 20px rgba(255, 255, 255, 0.3);
}

.particle.small { width: 6px; height: 6px; background: rgba(255, 255, 255, 0.6); }
.particle.medium { width: 12px; height: 12px; background: rgba(255, 255, 255, 0.45); }
.particle.large { width: 18px; height: 18px; background: rgba(255, 255, 255, 0.35); }

@keyframes float {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-100vh) rotate(720deg); opacity: 0; }
}

/* ============ UTILIDADES ============ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .header-container { flex-direction: column; gap: 15px; }
    .form-card { padding: 25px 20px; }
    .form-grid, .form-grid-3 { grid-template-columns: 1fr; }
    .form-title-section h2 { font-size: 26px; }
    .section-header { flex-direction: column; text-align: center; }
    .radio-group { flex-direction: column; }
    .form-actions { flex-direction: column; }
    .btn { width: 100%; justify-content: center; }
    .captcha-container { flex-direction: column; align-items: stretch; }
}

@media (max-width: 968px) {
    .header-container { flex-direction: column; gap: 15px; }
}

/* ============ SPINNER ============ */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

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

/* ============ TOOLTIP ============ */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip:hover::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background: #2d3748;
    color: white;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    z-index: 100;
}
