:root {
    --primary-green: #0450B1;
    /* azul principal */
    --secondary-green: #2B73D2;
    /* azul secundario más claro */
    --light-green: #A3C9F9;
    /* azul muy claro, casi pastel */
    --accent-green: #6FA7E0;
    /* azul acento intermedio */

    --background-gray: #F5F7FA;
    --card-white: #FFFFFF;
    --text-dark: #2D3748;
    --text-medium: #4A5568;
    --text-light: #718096;
    --border-color: #E2E8F0;

    --shadow-light: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-large: 0 10px 25px rgba(0, 0, 0, 0.15);
}

* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--background-gray) 0%, #E8F4F8 100%);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    min-height: 100vh;
}

.main-container {
    background: var(--background-gray);
    min-height: 100vh;
    padding: 2rem 0;
}

.form-section {
    background: var(--card-white);
    border-radius: 16px;
    box-shadow: var(--shadow-medium);
    margin-bottom: 2rem;
    padding: 2rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.form-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
}

.form-section:hover {
    box-shadow: var(--shadow-large);
    transform: translateY(-2px);
}

.section-title {
    color: var(--primary-green);
    font-weight: 600;
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--light-green);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 2px;
    background: var(--primary-green);
}

.header-card {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    color: white;
    text-align: center;
    padding: 3rem 2rem;
    border-radius: 20px;
    margin-bottom: 3rem;
    box-shadow: var(--shadow-large);
    position: relative;
    overflow: hidden;
}

.header-card::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: float 6s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(180deg);
    }
}

.header-card h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.header-card p {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

.form-control {
    border: 2px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: #FAFBFC;
}

.form-control:focus {
    border-color: var(--primary-green);
    box-shadow: 0 0 0 3px rgba(107, 142, 90, 0.1);
    background: white;
    outline: none;
}

.form-control:hover {
    border-color: var(--secondary-green);
}

label {
    font-weight: 500;
    color: var(--text-medium);
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.required {
    color: #E53E3E;
    font-weight: 600;
}

.form-check-input:checked {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(107, 142, 90, 0.25);
}

.form-check-label {
    color: var(--text-medium);
    font-weight: 400;
}

.table-responsive {
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--border-color);
}

.table {
    margin-bottom: 0;
    font-size: 0.9rem;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-green), var(--accent-green));
    color: white;
    font-weight: 600;
    border: none;
    padding: 1rem 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: #F7FAFC;
}

.table td {
    border-color: var(--border-color);
    padding: 0.75rem;
    vertical-align: middle;
}

.table-responsive input,
.table-responsive select {
    border: none;
    background: transparent;
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-dark);
}

.table-responsive input:focus,
.table-responsive select:focus {
    outline: none;
    background-color: #F0F8F0;
    border-radius: 4px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-green), var(--secondary-green));
    border: none;
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-medium);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #5A7A4A, var(--primary-green));
    transform: translateY(-2px);
    box-shadow: var(--shadow-large);
}

.btn-outline-primary {
    border: 2px solid var(--primary-green);
    color: var(--primary-green);
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-green);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

.btn-outline-secondary {
    border: 2px solid var(--text-light);
    color: var(--text-light);
    border-radius: 10px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

.btn-outline-secondary:hover {
    background: var(--text-light);
    color: white;
    transform: translateY(-2px);
}

.signature-section {
    border-top: 2px solid var(--primary-green);
    width: 300px;
    margin: 3rem auto;
    padding-top: 1rem;
    text-align: center;
    position: relative;
}

.signature-section::before {
    content: '✍️';
    position: absolute;
    top: -15px;
    left: 50%;
    transform: translateX(-50%);
    background: white;
    padding: 0 10px;
    font-size: 1.2rem;
}

.declaration-text {
    text-align: justify;
    line-height: 1.7;
    font-size: 0.95rem;
    color: var(--text-medium);
    background: #F8FDF8;
    padding: 1.5rem;
    border-radius: 12px;
    border-left: 4px solid var(--primary-green);
    position: relative;
}

.declaration-text::before {
    content: '📋';
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    opacity: 0.3;
}

.conditional-field {
    background: #F0F8F0;
    border: 1px solid var(--light-green);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 0.5rem;
    transition: all 0.3s ease;
}

.form-group {
    margin-bottom: 1.5rem;
}

.text-muted {
    color: var(--text-light) !important;
    font-style: italic;
    font-size: 0.9rem;
}

.alert-success {
    background: linear-gradient(135deg, #F0FFF4, #E6FFFA);
    border: 1px solid var(--light-green);
    color: var(--primary-green);
    border-radius: 12px;
}

.alert-danger {
    background: linear-gradient(135deg, #FFF5F5, #FED7D7);
    border: 1px solid #FEB2B2;
    color: #C53030;
    border-radius: 12px;
}

.progress {
    height: 6px;
    border-radius: 10px;
    background: var(--border-color);
    margin-bottom: 2rem;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-green), var(--secondary-green));
    border-radius: 10px;
}

.floating-label {
    position: relative;
}

.floating-label input:focus+label,
.floating-label input:not(:placeholder-shown)+label {
    transform: translateY(-1.5rem) scale(0.8);
    color: var(--primary-green);
}

.floating-label label {
    position: absolute;
    top: 0.75rem;
    left: 1rem;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 0.25rem;
}

/* Responsive improvements */
@media (max-width: 768px) {
    .main-container {
        padding: 1rem;
    }

    .form-section {
        margin: 0 0 1.5rem;
        padding: 1.5rem;
        border-radius: 12px;
    }

    .header-card {
        margin: 0 0 2rem;
        padding: 2rem 1rem;
        border-radius: 16px;
    }

    .header-card h1 {
        font-size: 2rem;
    }

    .table-responsive {
        font-size: 0.8rem;
    }

    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .signature-section {
        width: 100%;
        max-width: 300px;
    }
}

/* Extra small screens */
@media (max-width: 576px) {
    .main-container {
        padding: 0.5rem;
    }

    .form-section {
        margin: 0 0 1rem;
        padding: 1rem;
    }

    .header-card {
        margin: 0 0 1.5rem;
        padding: 1.5rem 0.75rem;
    }

    .header-card h1 {
        font-size: 1.5rem;
    }

    .header-card p {
        font-size: 1rem;
    }

    .section-title {
        font-size: 1.25rem;
    }

    .table-responsive {
        font-size: 0.75rem;
    }

    .form-control {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }

    label {
        font-size: 0.85rem;
    }

    .btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
    }

    .signature-section {
        width: 100%;
        max-width: 250px;
    }
}

/* Loading animation */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(107, 142, 90, 0.3);
    border-radius: 50%;
    border-top-color: var(--primary-green);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Success checkmark animation */
.checkmark {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--primary-green);
    position: relative;
}

.checkmark::after {
    content: '';
    position: absolute;
    left: 8px;
    top: 4px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Smooth transitions for all interactive elements */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--background-gray);
}

::-webkit-scrollbar-thumb {
    background: var(--secondary-green);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-green);
}

/* Fondo de overlay */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

/* Spinner circular */
.spinner {
    width: 60px;
    height: 60px;
    border: 6px solid #ddd;
    border-top: 6px solid #0004AD;
    /* Azul principal */
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Animación */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}