:root {
    --color-primary: #1A3A5C;
    --color-accent: #f18c21;
    --color-accent-hover: #d97b1c;
    --color-bg: #F8FAFB;
    --color-surface: #FFFFFF;
    --color-text: #1C2B3A;
    --color-muted: #6B7E8F;
    --color-success: #22C55E;
    --color-warning: #FBBF24;
    --color-danger: #EF4444;
    --color-border: #E2E8F0;
    --color-blue-logo: #046ca4;
    --color-orange-logo: #f18c21;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Montserrat', system-ui, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1120px, 92%);
    margin: 0 auto;
}

/* Header */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header .inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header img {
    height: 48px;
    width: auto;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.header-actions .btn-outline {
    padding: 0.55rem 1.25rem;
    font-size: 0.875rem;
}

/* Cards */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(26, 58, 92, 0.06);
}

.card-enter {
    animation: cardEnter 0.3s ease-out;
}

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

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    border-radius: 999px;
    padding: 0.85rem 1.75rem;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    text-decoration: none;
}

.btn:hover {
    text-decoration: none;
    transform: translateY(-1px);
}

.btn-primary {
    background: var(--color-accent);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-accent-hover);
    color: #fff;
}

.btn-secondary {
    background: var(--color-primary);
    color: #fff;
}

.btn-success {
    background: var(--color-success);
    color: #fff;
}

.btn-success:hover {
    background: #1aad4f;
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.btn-full {
    width: 100%;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    text-align: left;
}

.form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.4rem;
}

.form-control {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    background: #fff;
}

.form-control:focus {
    outline: 2px solid rgba(245, 166, 35, 0.35);
    border-color: var(--color-accent);
}

/* Landing — pantalla de consulta DNI */
body.landing-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: url('/assets/img/fondo.jpg') center center / cover no-repeat fixed;
    color: #fff;
}

.landing-header {
    position: relative;
    padding: 1.5rem 1.25rem 0;
    text-align: center;
    z-index: 10;
}

.landing-logo {
    display: inline-block;
    margin-top: 0.5rem;
}

.landing-logo img,
.logo-white {
    height: 56px;
    width: auto;
    filter: brightness(0) invert(1);
}

.btn-glass-back {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.55rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.35);
    transition: background 0.2s, transform 0.15s;
}

.btn-glass-back:hover {
    background: rgba(255, 255, 255, 0.28);
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
}

.landing-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem 1.25rem 2rem;
}

.landing-footer {
    text-align: center;
    padding: 1rem 1.25rem 1.25rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.75);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.landing-footer p {
    margin: 0;
}

/* Tarjeta liquid glass */
.glass-card {
    position: relative;
    max-width: 440px;
    width: 100%;
    padding: 2rem 1.75rem;
    border-radius: 24px;
    text-align: center;
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(20px) saturate(1.4);
    -webkit-backdrop-filter: blur(20px) saturate(1.4);
    border: 1px solid rgba(255, 255, 255, 0.45);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.consulta-section {
    width: 100%;
    display: flex;
    justify-content: center;
}

.consulta-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.consulta-card .subtitle {
    color: rgba(255, 255, 255, 0.88);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.consulta-card .form-group label {
    color: rgba(255, 255, 255, 0.95);
}

.form-control-glass {
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: var(--color-text);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.form-control-glass::placeholder {
    color: var(--color-muted);
}

.form-control-glass:focus {
    background: rgba(255, 255, 255, 0.72);
    border-color: rgba(255, 255, 255, 0.7);
    outline: none;
    box-shadow: 0 0 0 3px rgba(245, 166, 35, 0.35);
}

.btn-glass-outline {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-glass-outline:hover {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

.landing-page .alert-error {
    background: rgba(254, 242, 242, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.landing-page .alert-not-found {
    background: rgba(255, 255, 255, 0.88);
    color: var(--color-text);
    border: 1px solid rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    text-align: center;
}

@media (max-width: 520px) {
    .btn-glass-back {
        top: 1rem;
        right: 1rem;
        padding: 0.5rem 0.85rem;
        font-size: 0.8rem;
    }

    .btn-back-text {
        display: none;
    }

    .landing-logo img,
    .logo-white {
        height: 48px;
    }

    .glass-card {
        padding: 1.5rem 1.25rem;
    }
}

.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 1rem;
    font-size: 0.9rem;
    text-align: left;
}

.alert-error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: #EFF6FF;
    color: #1E40AF;
    border: 1px solid #BFDBFE;
}

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

/* Dashboard */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
    padding: 2rem 0 3rem;
}

@media (min-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 3fr 2fr;
    }
}

.dashboard-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.25rem 0;
    flex-wrap: wrap;
}

.amount {
    font-size: 2rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    color: var(--color-primary);
    margin: 0.25rem 0;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-success { background: #DCFCE7; color: #166534; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-info { background: #DBEAFE; color: #1E40AF; }
.badge-accent { background: #FEF3C7; color: #B45309; }

.card-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 1.1rem;
    margin: 0 0 1rem;
    color: var(--color-primary);
}

.savings {
    background: #FFFBEB;
    border: 1px dashed var(--color-accent);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    margin: 1rem 0;
    font-size: 0.9rem;
}

.savings strong {
    color: var(--color-accent);
    font-size: 1.1rem;
}

/* Upload zone */
.dropzone {
    border: 2px dashed var(--color-border);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover,
.dropzone.dragover {
    border-color: var(--color-accent);
    background: #FFFBEB;
}

.dropzone input {
    display: none;
}

.preview-box {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--color-bg);
    border-radius: 12px;
    font-size: 0.9rem;
}

/* Admin */
.admin-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
}

.stat-card .number {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.admin-table th,
.admin-table td {
    padding: 0.65rem;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
}

.admin-table th {
    background: var(--color-bg);
    font-weight: 600;
}

.site-footer {
    background: var(--color-primary);
    color: rgba(255, 255, 255, 0.85);
    padding: 2rem 0;
    margin-top: auto;
    font-size: 0.85rem;
}

.site-footer a {
    color: #fff;
}

.spin {
    animation: spin 1s linear infinite;
}

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

.hidden {
    display: none !important;
}
