/* ========== SISTEMA DE DISEÑO UNIFICADO ========== */
/* Paleta: Verde institucional (#5C9C31) + neutros + teoría del color */

:root {
    --color-primary: #5C9C31;
    --color-primary-dark: #457A28;
    --color-primary-light: #7AB84A;
    --color-accent: #0d9488;
    --color-neutral-50: #f8fafc;
    --color-neutral-100: #f1f5f9;
    --color-neutral-200: #e2e8f0;
    --color-neutral-300: #cbd5e1;
    --color-neutral-500: #64748b;
    --color-neutral-600: #475569;
    --color-neutral-700: #334155;
    --color-neutral-900: #0f172a;
    --color-success-soft: #dcfce7;
    --color-info-soft: #e0f2fe;
    --color-focus-ring: rgba(92, 156, 49, 0.35);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

html, body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Work Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, var(--color-neutral-50) 0%, var(--color-neutral-100) 100%);
    color: var(--color-neutral-700);
    line-height: 1.6;
    min-height: 100vh;
}

/* ========== HEADER / BANNER ========== */
.static-header {
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 16px 24px;
    min-height: 64px;
    position: relative;
    color: white;
    box-shadow: var(--shadow-md);
}

.header-left, .header-right {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.header-left { left: 24px; }
.header-right { right: 24px; }

.header-center {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.header-logo {
    max-width: 160px;
    height: auto;
    display: block;
}

.btn-logout {
    background: transparent;
    border: none;
    cursor: pointer;
    color: white;
    font-size: 22px;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s, color 0.2s;
}

.btn-logout:hover,
.btn-logout:hover .fas {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

.btn-logout .fas { font-size: 22px; }

@media (max-width: 640px) {
    .static-header {
        padding: 12px 16px;
        min-height: 56px;
    }

    .header-logo {
        max-width: 130px;
    }

    .header-left { left: 16px; }
    .header-right { right: 16px; }
}

/* ========== CONTENEDOR PRINCIPAL ========== */
.container {
    max-width: 680px;
    margin: 32px auto 48px;
    padding: 0 20px;
}

.container h1 {
    text-align: center;
    color: var(--color-neutral-900);
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.container h1::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 28px;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border-radius: 2px;
}

/* ========== CARD (formularios, declaraciones) ========== */
.form-card,
.declaraciones {
    background: white;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    margin-bottom: 24px;
    border: 1px solid var(--color-neutral-200);
}

.form-card h2,
.declaraciones h2 {
    margin: 0;
    padding: 20px 24px;
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--color-neutral-900);
    background: linear-gradient(90deg, var(--color-success-soft) 0%, var(--color-neutral-50) 100%);
    border-bottom: 1px solid var(--color-neutral-200);
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-card h2 i,
.declaraciones h2 i {
    color: var(--color-primary);
    font-size: 1rem;
}

/* ========== FORMULARIOS ========== */
.registro-form,
form.form-card-form {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.form-group {
    margin-bottom: 18px;
}

.form-group:last-of-type {
    margin-bottom: 24px;
}

label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--color-neutral-700);
}

label .label-icon {
    color: var(--color-primary);
    font-size: 0.9rem;
    width: 18px;
    text-align: center;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="file"],
input[type="number"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--color-neutral-200);
    border-radius: 10px;
    font-size: 0.9375rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

input::placeholder,
textarea::placeholder {
    color: var(--color-neutral-500);
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--color-primary);
    outline: none;
    box-shadow: 0 0 0 3px var(--color-focus-ring);
}

input:hover,
select:hover,
textarea:hover {
    border-color: var(--color-neutral-500);
}

/* Errores de formulario */
.errorlist {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
    font-size: 0.8125rem;
    color: #dc2626;
}

/* ========== BOTONES ========== */
.btn-submit,
.btn-primary {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.0625rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 4px 14px rgba(92, 156, 49, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

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

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

.btn-submit i,
.btn-primary i {
    font-size: 1.125rem;
}

.btn-secondary {
    background: var(--color-neutral-100);
    color: var(--color-neutral-900);
    padding: 14px 24px;
    border-radius: 10px;
    border: 1px solid var(--color-neutral-200);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    transition: background 0.2s, border-color 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.btn-secondary:hover {
    background: var(--color-neutral-200);
    border-color: var(--color-neutral-300);
}

/* ========== ENLACES ========== */
a {
    color: var(--color-primary);
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: color 0.2s, border-color 0.2s;
}

a:hover {
    color: var(--color-primary-dark);
    border-bottom-color: var(--color-primary-dark);
}

a:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* ========== MODAL Y LOADER ========== */
.modal {
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background-color: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: white;
    margin: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.modal-content.modal-simple {
    padding: 24px;
    text-align: center;
}

.loader {
    border: 4px solid var(--color-neutral-200);
    border-top: 4px solid var(--color-primary);
    border-radius: 50%;
    width: 48px;
    height: 48px;
    animation: baseSpin 0.8s linear infinite;
    margin: 16px auto;
}

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

/* ========== MENSAJES ========== */
.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 16px;
}

.messages li {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 0.9375rem;
}

.messages .success { background: var(--color-success-soft); color: var(--color-primary-dark); }
.messages .error { background: #fee2e2; color: #dc2626; }
.messages .warning { background: #fef3c7; color: #b45309; }
.messages .info { background: var(--color-info-soft); color: #0369a1; }

/* ========== RESPONSIVE BASE ========== */
@media (max-width: 640px) {
    .container {
        margin: 20px auto 32px;
        padding: 0 16px;
    }

    .container h1 {
        font-size: 1.375rem;
        flex-direction: column;
        gap: 8px;
    }

    .container h1::before {
        width: 40px;
        height: 4px;
    }

    .form-card h2,
    .declaraciones h2 {
        padding: 16px 18px;
        font-size: 1rem;
    }

    .registro-form,
    form.form-card-form {
        padding: 18px;
    }

    .btn-submit,
    .btn-primary {
        padding: 14px 20px;
        font-size: 1rem;
    }
}
