@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

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

body {
    font-family: 'Outfit', sans-serif;
    background: radial-gradient(circle at 10% 20%, rgba(163, 191, 250, 0.25) 0%, transparent 40%),
                radial-gradient(circle at 90% 80%, rgba(165, 243, 252, 0.35) 0%, transparent 50%),
                radial-gradient(circle at 50% 90%, rgba(212, 252, 237, 0.25) 0%, transparent 40%),
                #f8fafc;
    color: #0f172a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.container {
    width: 100%;
    max-width: 750px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Cabecera del Portal */
.portal-header {
    text-align: center;
    margin-bottom: 12px;
}

.logo-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 24px;
    margin-bottom: 24px;
}

.corp-logo {
    height: 46px;
    max-width: 200px;
    object-fit: contain;
}

.portal-header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.portal-intro {
    color: #64748b;
    font-size: 1rem;
    line-height: 1.5;
    font-weight: 400;
}

/* Tarjeta del Formulario de Búsqueda */
.search-form-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(226, 232, 240, 0.8);
    width: 100%;
}

.form-group-inline {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-group-inline label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.search-input-group {
    display: flex;
    gap: 16px;
    width: 100%;
}

.search-input-group input {
    flex: 1;
    padding: 14px 18px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.95rem;
    color: #0f172a;
    font-family: inherit;
    transition: all 0.25s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.01);
}

.search-input-group input:focus {
    outline: none;
    border-color: #4f46e5;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.12);
}

/* Botones */
button {
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    padding: 14px 28px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.25s ease;
}

.btn-search {
    background: #4f46e5;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.15);
    white-space: nowrap;
    width: auto;
}

.btn-search:hover {
    background: #4338ca;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.2);
}

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

.btn-success {
    background: #059669;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(5, 150, 105, 0.15);
    width: 100%;
}

.btn-success:hover {
    background: #047857;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(5, 150, 105, 0.2);
}

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

.btn-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Alertas de error */
.notice.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    line-height: 1.4;
    animation: fadeIn 0.4s ease-out;
}

.alert-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    color: #ef4444;
}

/* Tarjeta de Resultados */
.result-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.03), 0 1px 3px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.4s ease-out;
}

.result-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    border-bottom: 1.5px solid #f1f5f9;
    padding-bottom: 20px;
}

.result-title-container {
    display: flex;
    flex-direction: column;
}

.result-heading h2 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-top: 4px;
    line-height: 1.4;
    letter-spacing: -0.3px;
}

.status-pill {
    white-space: nowrap;
    color: #047857;
    background: #d1fae5;
    border-radius: 9999px;
    padding: 5px 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.download-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.download-form label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 8px;
}

.download-form select {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    font-size: 0.95rem;
    color: #0f172a;
    font-family: inherit;
    transition: all 0.25s ease;
}

.download-form select:focus {
    outline: none;
    border-color: #059669;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

/* Pie de Página */
.portal-footer {
    text-align: center;
    margin-top: 16px;
    font-size: 0.85rem;
    color: #94a3b8;
    font-weight: 500;
}

/* Pantalla de carga / Modal */
.loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.loader-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.loader-card {
    background: #ffffff;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15);
    text-align: center;
    max-width: 420px;
    width: 90%;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    border: 1px solid rgba(226, 232, 240, 0.6);
}

.loader-overlay.active .loader-card {
    transform: translateY(0);
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #f1f5f9;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    margin: 0 auto 24px;
    animation: spin 0.8s linear infinite;
}

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

.loader-card h3 {
    margin: 0 0 12px;
    color: #0f172a;
    font-size: 1.3rem;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.loader-card p {
    margin: 0;
    color: #475569;
    font-size: 0.9rem;
    line-height: 1.6;
    font-weight: 300;
}

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

/* ============================================================
   RESPONSIVE — Tablets (≤ 768px)
   ============================================================ */
@media (max-width: 768px) {
    body {
        padding: 24px 16px;
        justify-content: flex-start;
        align-items: stretch;
    }

    .container {
        gap: 16px;
        max-width: 100%;
    }

    .portal-header h1 {
        font-size: 1.7rem;
        letter-spacing: -0.3px;
    }

    .logo-header {
        gap: 16px;
        margin-bottom: 18px;
    }

    .corp-logo {
        height: 38px;
    }

    .search-form-card {
        padding: 20px;
    }

    .result-card {
        padding: 20px;
        gap: 18px;
    }

    .result-heading {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .status-pill {
        align-self: flex-start;
    }
}

/* ============================================================
   RESPONSIVE — Móviles (≤ 480px)
   ============================================================ */
@media (max-width: 480px) {
    body {
        padding: 16px 12px;
    }

    .portal-header h1 {
        font-size: 1.4rem;
    }

    .portal-intro {
        font-size: 0.9rem;
    }

    .logo-header {
        gap: 12px;
        flex-wrap: wrap;
        justify-content: center;
    }

    .corp-logo {
        height: 32px;
        max-width: 130px;
    }

    /* Input y botón apilados verticalmente */
    .search-input-group {
        flex-direction: column;
        gap: 10px;
    }

    .btn-search {
        width: 100%;
        padding: 14px;
        justify-content: center;
    }

    .search-form-card {
        padding: 16px;
        border-radius: 12px;
    }

    .result-card {
        padding: 16px;
        border-radius: 12px;
        gap: 14px;
    }

    .result-heading h2 {
        font-size: 1.05rem;
    }

    .eyebrow {
        font-size: 0.7rem;
    }

    .download-form select {
        font-size: 0.9rem;
        padding: 12px 14px;
    }

    .btn-success {
        padding: 14px;
        font-size: 0.9rem;
    }

    .loader-card {
        padding: 28px 20px;
        margin: 0 12px;
    }

    .loader-card h3 {
        font-size: 1.1rem;
    }

    .loader-card p {
        font-size: 0.85rem;
    }

    .portal-footer {
        font-size: 0.78rem;
        margin-top: 8px;
    }
}

/* ============================================================
   RESPONSIVE — Móviles muy pequeños (≤ 360px)
   ============================================================ */
@media (max-width: 360px) {
    .portal-header h1 {
        font-size: 1.25rem;
    }

    .corp-logo {
        height: 28px;
        max-width: 110px;
    }

    .search-form-card,
    .result-card {
        padding: 14px;
    }
}
