:root {
    --primary-blue: #0066cc;
    --primary-blue-dark: #0052a3;
    --primary-blue-light: #e6f0ff;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --success: #10b981;
    --error: #ef4444;
    --warning: #f59e0b;
    --success-dark: #0b8e62;
    --error-dark: #c93737;
    --warning-dark: #d18809;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --radius: 0.5rem;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, var(--gray-100) 0%, var(--white) 100%);
    color: var(--gray-800);
    line-height: 1.5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    padding: 1rem;
    background-image: url('../assets/background_black.png');
    background-size: cover;
    background-position: center;
}

.logos-box{
    padding: 1rem;
    background-color: var(--gray-100);
    margin-top: 0.5rem;
    border-radius: 1rem;
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-evenly;
    animation: slideUp 0.5s ease-out;
}

.logos-box .logo{
    display: inline-block;
    width: 100px;
    height: 100px;
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    animation: slideUp 0.5s ease-out;
}

.logos-box .logo.sinchi{
    background-image: url('../assets/logos/sinchi.png');
}

.logos-box .logo.minambiente{
    background-image: url('../assets/logos/minambiente.png');
}

.logos-box .logo.ndfyb{
    background-image: url('../assets/logos/ndfyb.png');
}

h1, h2, h3 {
    font-weight: 600;
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-blue);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-blue-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-link {
    background: transparent;
    color: var(--primary-blue);
    padding: 0.5rem 1rem;
}

.btn-link:hover {
    background: var(--primary-blue-light);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-option {
    flex: 1;
    padding: 1rem 2rem;
    font-size: 1.125rem;
    background: var(--white);
    border: 2px solid var(--gray-300);
    color: var(--gray-600);
}

.btn-option:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

.btn-option.selected {
    color: var(--primary-blue);
    border-color: #0066cc;
    background-color: var(--primary-blue-light);
    font-weight: 600;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--gray-700);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    transition: var(--transition);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

.form-input::placeholder {
    color: var(--gray-400);
}

.form-hint {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.75rem;
    color: var(--gray-500);
}

.alert {
    padding: 1rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    animation: slideDown 0.3s ease-out;
}

.alert-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    color: #166534;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes pulse {
0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.welcome-container {
    width: 100%;
    max-width: 480px;
    animation: fadeIn 0.5s ease-out;
}

.welcome-card {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    animation: slideUp 0.5s ease-out;
}

.welcome-header {
    text-align: center;
    margin-bottom: 2rem;
}

.welcome-header h1 {
    font-size: 1.75rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.welcome-subtitle {
    color: var(--gray-500);
    font-size: 0.95rem;
}

.welcome-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.form-container {
    width: 100%;
    max-width: 600px;
    animation: fadeIn 0.5s ease-out;
}

.form-card {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1.5rem;
    animation: slideUp 0.5s ease-out;
}

.form-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.form-header h1 {
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-500);
    font-weight: 600;
    transition: var(--transition);
}

.step-label {
    font-size: 0.75rem;
    color: var(--gray-500);
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-blue);
    color: var(--white);
}

.step.active .step-label {
    color: var(--primary-blue);
    font-weight: 500;
}

.step.completed .step-number {
    background: var(--success);
    color: var(--white);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
    margin-bottom: 1.5rem;
}

.form-step {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.form-step.active {
    display: block;
}

.step-title {
    margin-bottom: 1.5rem;
}

.step-title h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
}

.data-display {
    background: var(--gray-50);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.data-row {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--gray-200);
}

.data-row:last-child {
    border-bottom: none;
}

.data-label {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.data-value {
    font-weight: 500;
    color: var(--gray-800);
}

.data-value.highlight {
    color: var(--primary-blue);
    font-size: 1.1rem;
}

.question-container {
    margin-bottom: 1.5rem;
}

.question-label {
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}

.btn-group-horizontal {
    display: flex;
    gap: 1rem;
}

.conditional-section {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: var(--gray-50);
    border-radius: var(--radius);
    animation: slideDown 0.3s ease-out;
}

.hidden {
    display: none !important;
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-200);
}

.form-actions .btn {
    flex: 1;
}

.upload-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.upload-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--gray-700);
}

.file-input-wrapper {
    position: relative;
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-preview {
    height: 120px;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gray-50);
    transition: var(--transition);
    overflow: hidden;
}

.file-preview:hover {
    border-color: var(--primary-blue);
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.file-placeholder {
    color: var(--gray-400);
    font-size: 0.875rem;
}

.message-container {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: var(--radius);
    text-align: center;
    animation: slideDown 0.3s ease-out;
}

.completion-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 2rem;
    animation: slideUp 0.5s ease-out;
}

.completion-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 1.5rem;
}

.completion-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.completion-subtitle {
    font-size: 1rem;
    color: var(--gray-500);
    margin-bottom: 2rem;
}

.login-container {
    width: 100%;
    max-width: 400px;
    animation: fadeIn 0.5s ease-out;
}

.login-card {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    animation: slideUp 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.login-header h1 {
    font-size: 1.5rem;
    color: var(--primary-blue);
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--gray-500);
    font-size: 0.9rem;
}

.login-footer {
    margin-top: 1.5rem;
    text-align: center;
}

.dashboard-container {
    width: 100%;
    max-width: 1600px;
    animation: fadeIn 0.5s ease-out;
}

.dashboard-header {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.dashboard-header h1 {
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
}

.admin-user {
    color: var(--gray-600);
    font-size: 0.9rem;
}

.table-container {
    background: var(--white);
    border-radius: 1rem;
    box-shadow: var(--shadow-lg);
    padding: 1rem;
    overflow-x: auto;
    animation: slideUp 0.5s ease-out;
}

table.display {
    width: 100%;
    border-collapse: collapse;
}

table.display thead th {
    background: var(--gray-50);
    color: var(--gray-700);
    font-weight: 600;
    text-align: left;
    padding: 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    white-space: nowrap;
}

table.display tbody td {
    padding: 0.75rem;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

table.display tbody tr:hover {
    background: var(--gray-50);
}

table.display tbody tr:last-child td {
    border-bottom: none;
}

.btn-view-image {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
    cursor: pointer;
    border: none;
    transition: var(--transition);
    background-color: inherit;
    border-radius: 1rem;
}

.btn-view-image:hover {
    background: var(--gray-100);
}

.existing-image-container {
    position: relative;
    width: 100%;
    height: 100%;
}

.existing-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.btn-remove-image {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(239, 68, 68, 0.9);
    color: white;
    border: 2px solid white;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    z-index: 2;
}

.btn-remove-image:hover {
    background: var(--error);
    transform: scale(1.1);
}

.file-input-wrapper.replaced .existing-image-container {
    display: none;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.modal.show {
    display: flex;
}

.modal-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    animation: slideUp 0.3s ease-out;
}

.modal-content img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: var(--radius);
}

.modal-close {
    position: absolute;
    top: -20px;
    right: -20px;
    color: var(--white);
    font-size: 2rem;
    cursor: pointer;
    transition: var(--transition);
    width: 40px;
    height: 40px;
    line-height: 35px;
    text-align: center;
    background-color: white;
    color: black;
    border-radius: 5px;
}

.modal-close:hover {
    color: var(--gray-300);
}

@media (min-width: 640px) {
    .welcome-card,
    .login-card,
    .form-card {
        padding: 2.5rem;
    }

    .dashboard-header {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        background-color: white;
        padding: 24px;
        border-radius: 1rem;
    }

    .header-actions {
        flex-direction: row;
        align-items: center;
    }

    .admin-user {
        margin-right: 1rem;
    }
}

@media (min-width: 768px) {
    .upload-section {
        grid-gap: 2rem;
    }

    .step-indicator {
        padding: 0 2rem;
    }

    .step-label {
        font-size: 0.875rem;
    }
}

@media (min-width: 1024px) {
    .main-content {
        padding: 2rem;
    }

    .welcome-header h1 {
        font-size: 2rem;
    }

    .form-header h1 {
        font-size: 1.75rem;
    }

    .step-title h2 {
        font-size: 1.5rem;
    }
}

.dataTables_wrapper {
    padding: 0 !important;
}

.dataTables_wrapper .dataTables_filter {
    margin-bottom: 1rem;
    text-align: right;
}

.dataTables_wrapper .dataTables_filter input {
    padding: 0.5rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    margin-left: 0.5rem;
    min-width: 250px;
}

.dataTables_wrapper .dataTables_filter input:focus {
    border-color: var(--primary-blue);
    outline: none;
}

.dataTables_wrapper .dataTables_length {
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_length select {
    padding: 0.5rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
}

.dataTables_wrapper .dataTables_scroll {
    border-bottom: 2px solid #f5f5f5;
    margin-bottom: 1rem;
}

.dataTables_wrapper .dataTables_paginate {
    margin-top: 1rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button {
    padding: 0.5rem 0.75rem !important;
    border-radius: var(--radius) !important;
    margin: 0 0.25rem;
}

.dataTables_wrapper .dataTables_paginate .paginate_button.current {
    background: var(--primary-blue) !important;
    color: var(--white) !important;
    border-color: var(--primary-blue) !important;
}

.dataTables_wrapper .dataTables_paginate .paginate_button:hover {
    background: var(--primary-blue-light) !important;
    color: var(--primary-blue) !important;
}

table.display thead tr.filters th {
    background: var(--white);
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--gray-200);
    vertical-align: middle;
}

table.display thead tr.filters th .filter-input-wrapper {
    width: 100%;
    display: block;
}

table.display thead tr.filters th .filter-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    background: var(--white);
    color: var(--gray-700);
    transition: var(--transition);
    box-sizing: border-box;
    display: block;
}

table.display thead tr.filters th .filter-input:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px var(--primary-blue-light);
}

table.display thead tr.filters th .filter-input::placeholder {
    color: var(--gray-400);
}

table.display thead tr.filters th.no-filter {
    padding: 0;
    border-bottom: 2px solid var(--white);
}

table.display thead tr.filters th.no-filter .filter-input-wrapper {
    display: none;
}

.dataTables_scrollHeadInner {
    width: 100% !important;
}

.dataTables_scrollBody {
    border-bottom: none !important;
}

.dt-buttons {
    margin-bottom: 1rem;
    margin-right: 1rem;
}

.dt-buttons .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.875rem !important;
    background: var(--primary-blue) !important;
    color: var(--white) !important;
    border: none !important;
    border-radius: var(--radius) !important;
}

.dt-buttons .btn:hover {
    background: var(--primary-blue-dark) !important;
}

.dt-buttons .btn.btn-excel{
    background: var(--success) !important;
}

.dt-buttons .btn.btn-imagenes{
    background: var(--warning) !important;
}

.dt-buttons .btn.btn-excel:hover{
    background: var(--success-dark) !important;
}

.dt-buttons .btn.btn-imagenes:hover{
    background: var(--warning-dark) !important;
}