/* =========================================
   VARIABLES INSTITUCIONALES
========================================= */

:root {
    --cal-blue: #12365f;
    --cal-blue-light: #1f4f82;
    --cal-gold: #c9a33b;
    --cal-gold-light: #e0c46c;

    --cal-white: #ffffff;
    --cal-footer: #f2f2f2;

    --cal-text: #1f2937;
    --cal-text-muted: #667085;

    --cal-border: #e5e7eb;
    --cal-border-light: #edf0f4;
}
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* =========================================
   ESTRUCTURA GENERAL
========================================= */

html,
body {
    width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    background: var(--cal-white) !important;
    color: var(--cal-text);

    font-family: "Source Sans Pro", Arial, sans-serif;
}

.wrapper {
    width: 100%;
    min-height: 100vh;

    display: flex;
    flex-direction: column;

    background: var(--cal-white) !important;
}

.wrapper > .container-fluid {
    width: 100%;
    min-height: 100vh;
    padding: 0;

    display: flex;
    flex-direction: column;

    background: var(--cal-white);
}


/* =========================================
   ENCABEZADO
========================================= */

.cal-header {
    width: 100%;
    flex-shrink: 0;

    background: var(--cal-white);
    text-align: center;
}

.cal-header-logo {
    min-height: 118px;
    padding: 18px 24px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-cal {
    display: block;

    width: auto;
    max-width: 310px;
    max-height: 82px;

    object-fit: contain;
}

.cal-header-line {
    width: 100%;
    height: 3px;

    background: linear-gradient(
        90deg,
        var(--cal-gold),
        var(--cal-gold-light),
        var(--cal-gold)
    );
}

.cal-header-title {
    padding: 30px 20px 18px;
}

.cal-header-badge {
    display: inline-block;

    margin-bottom: 10px;
    padding: 6px 14px;

    background: rgba(201, 163, 59, 0.1);
    color: #80651d;

    border: 1px solid rgba(201, 163, 59, 0.4);
    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.cal-header-title h1 {
    margin: 0;

    color: var(--cal-blue);

    font-size: 34px;
    font-weight: 700;
    letter-spacing: -0.5px;
    text-transform: uppercase;
}

.cal-header-title p {
    max-width: 560px;

    margin: 10px auto 0;

    color: var(--cal-text-muted);

    font-size: 16px;
    line-height: 1.5;
}


/* =========================================
   ÁREA PRINCIPAL DE BÚSQUEDA
========================================= */

.search-section {
    width: 100%;
    min-height: 0;
    padding: 25px 20px 40px;

    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: center;

    background: var(--cal-white);
}

.search-card {
    width: 100%;
    max-width: 480px;

    padding: 32px;

    background: var(--cal-white);

    border: 1px solid var(--cal-border-light);
    border-radius: 20px;

    box-shadow: 0 15px 40px rgba(15, 45, 82, 0.08);
}

.search-card-header {
    margin-bottom: 28px;
    text-align: center;
}

.search-icon {
    width: 52px;
    height: 52px;

    margin: 0 auto 16px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--cal-blue);
    color: var(--cal-white);

    border-radius: 50%;

    font-size: 19px;
}

.search-card-header h2 {
    margin: 0 0 8px;

    color: var(--cal-blue);

    font-size: 24px;
    font-weight: 700;
}

.search-card-header p {
    max-width: 360px;

    margin: 0 auto;

    color: var(--cal-text-muted);

    font-size: 15px;
    line-height: 1.5;
}


/* =========================================
   CAMPO DE BÚSQUEDA
========================================= */

.search-form-group {
    margin-bottom: 24px;
}

.search-form-group label {
    display: block;

    margin-bottom: 8px;

    color: var(--cal-blue);

    font-size: 14px;
    font-weight: 700;
}

.search-input-wrapper {
    position: relative;
}

.search-input-wrapper > .fa {
    position: absolute;
    top: 50%;
    left: 16px;

    z-index: 2;

    transform: translateY(-50%);

    color: var(--cal-blue);

    font-size: 16px;
    pointer-events: none;
}

.search-input {
    display: block;

    width: 100%;
    height: 50px;

    padding: 10px 15px 10px 45px;

    box-sizing: border-box;

    background: var(--cal-white);
    color: var(--cal-text);

    border: 1px solid #d6dae1;
    border-radius: 12px;
    outline: none;

    font-size: 16px;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.search-input::placeholder {
    color: #98a2b3;
}

.search-input:focus {
    border-color: var(--cal-gold);
    box-shadow: 0 0 0 4px rgba(201, 163, 74, 0.14);
}

.search-form-group small {
    display: block;

    margin-top: 8px;

    color: #7c8491;

    font-size: 13px;
}


/* =========================================
   BOTONES DEL BUSCADOR
========================================= */

.search-actions {
    display: flex;
    gap: 12px;
}

.search-button {
    min-height: 48px;
    padding: 12px 20px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    border: none;
    border-radius: 12px;

    font-size: 15px;
    font-weight: 700;
    text-decoration: none !important;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.search-button-primary {
    flex: 1;

    background: var(--cal-blue);
    color: var(--cal-white);
}

.search-button-primary:hover,
.search-button-primary:focus {
    background: var(--cal-blue-light);
    color: var(--cal-white);

    transform: translateY(-1px);
}

.search-button-secondary {
    background: #f3f4f6;
    color: #344054;

    border: 1px solid #e1e4e8;
}

.search-button-secondary:hover,
.search-button-secondary:focus {
    background: #e8ebef;
    color: var(--cal-blue);
}


/* =========================================
   SELECTOR DE TIPO DE BÚSQUEDA
========================================= */

.search-type-card {
    max-width: 520px;
}

.search-type-options {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.search-type-options form {
    margin: 0;
}

.search-type-button {
    width: 100%;
    min-height: 76px;
    padding: 14px 18px;

    display: flex;
    align-items: center;

    background: var(--cal-white);
    color: var(--cal-blue);

    border: 1px solid #dfe3e8;
    border-radius: 14px;

    text-align: left;
    cursor: pointer;

    transition:
        background-color 0.2s ease,
        color 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}

.search-type-button:hover,
.search-type-button:focus {
    border-color: var(--cal-gold);

    box-shadow: 0 8px 20px rgba(15, 45, 82, 0.08);

    transform: translateY(-2px);
    outline: none;
}

.search-type-primary {
    background: var(--cal-blue);
    color: var(--cal-white);

    border-color: var(--cal-blue);
}

.search-type-primary:hover,
.search-type-primary:focus {
    background: var(--cal-blue-light);
    color: var(--cal-white);
}

.search-type-icon {
    width: 44px;
    height: 44px;

    margin-right: 14px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;

    background: rgba(15, 45, 82, 0.08);

    border-radius: 12px;

    font-size: 17px;
}

.search-type-primary .search-type-icon {
    background: rgba(255, 255, 255, 0.14);
}

.search-type-content {
    display: flex;
    flex: 1;
    flex-direction: column;
}

.search-type-content strong {
    margin-bottom: 3px;

    font-size: 15px;
    font-weight: 700;
}

.search-type-content small {
    color: #7c8491;

    font-size: 13px;
    font-weight: 400;
}

.search-type-primary .search-type-content small {
    color: rgba(255, 255, 255, 0.72);
}

.search-type-arrow {
    margin-left: 12px;
    opacity: 0.7;
}


/* =========================================
   FOOTER
========================================= */

.cal-footer {
    width: 100%;
    margin-top: auto;
    padding: 18px 20px;

    flex: 0 0 auto;

    background: var(--cal-footer);
    color: #333333;

    border-top: 1px solid var(--cal-border);

    text-align: center;
}

.cal-footer p {
    margin: 0;

    font-size: 14px;
    line-height: 1.5;
}

.cal-footer strong {
    color: var(--cal-blue);
    font-weight: 700;
}

/* =========================================
   BÚSQUEDA POR NOMBRES
========================================= */

.search-name-card {
    max-width: 560px;
}

.search-captcha {
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.search-captcha-image {
    width: 140px;
    min-height: 50px;
    padding: 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f7f8fa;
    border: 1px solid #d6dae1;
    border-radius: 12px;
}

.search-captcha-image img {
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.search-captcha-input {
    flex: 1;
}

.search-input-simple {
    padding-left: 15px;
}

/* =========================================
   RESULTADO INDIVIDUAL
========================================= */

.result-section {
    width: 100%;
    min-height: 0;
    padding: 25px 20px 45px;

    display: flex;
    flex: 1 1 auto;
    align-items: flex-start;
    justify-content: center;

    background: var(--cal-white);
}

.result-card,
.result-list-card {
    width: 100%;
    max-width: 760px;

    overflow: hidden;

    background: var(--cal-white);

    border: 1px solid var(--cal-border-light);
    border-radius: 20px;

    box-shadow: 0 15px 40px rgba(15, 45, 82, 0.08);
}


/* Cabecera de la ficha */

.result-profile-header {
    padding: 30px;

    display: flex;
    align-items: center;
    gap: 26px;

    background: linear-gradient(
        135deg,
        var(--cal-blue),
        var(--cal-blue-light)
    );

    color: var(--cal-white);

    border-bottom: 4px solid var(--cal-gold);
}

.result-photo {
    width: 150px;
    height: 180px;

    position: relative;
    flex: 0 0 auto;
    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    background: #f4f5f7;

    border: 4px solid rgba(255, 255, 255, 0.85);
    border-radius: 16px;

    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
}

.result-photo img {
    display: block;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center top;
}

.result-photo-fallback {
    display: none;

    width: 100%;
    height: 100%;

    align-items: center;
    justify-content: center;

    color: #98a2b3;

    font-size: 60px;
}

.result-identity {
    min-width: 0;
    flex: 1;
}

.result-label {
    display: block;

    margin-bottom: 4px;

    color: rgba(255, 255, 255, 0.72);

    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.result-cal-number {
    margin-bottom: 11px;

    color: var(--cal-gold-light);

    font-size: 16px;
    font-weight: 700;
}

.result-identity h2 {
    margin: 0 0 18px;

    color: var(--cal-white);

    font-size: 27px;
    font-weight: 700;
    line-height: 1.25;
}


/* Estado */

.result-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 6px 10px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.result-status-large {
    padding: 8px 14px;
    font-size: 13px;
}

.result-status-enabled {
    background: #e8f7ef;
    color: #20784a;
}

.result-status-disabled {
    background: #fdecec;
    color: #b42318;
}


/* Información detallada */

.result-details {
    padding: 26px 30px;

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
}

.result-detail {
    min-height: 76px;
    padding: 15px 17px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    background: #f8f9fb;

    border: 1px solid #eaecf0;
    border-radius: 12px;
}

.result-detail-label {
    margin-bottom: 5px;

    color: var(--cal-text-muted);

    font-size: 12px;
    font-weight: 600;
}

.result-detail-label .fa {
    margin-right: 5px;
    color: var(--cal-blue);
}

.result-detail strong {
    color: var(--cal-blue);

    font-size: 15px;
    font-weight: 700;
}


/* Aviso */

.result-notice {
    margin: 0 30px 22px;
    padding: 14px 16px;

    display: flex;
    align-items: flex-start;
    gap: 11px;

    background: #f8f4e8;

    border-left: 4px solid var(--cal-gold);
    border-radius: 10px;

    color: #5c5131;
}

.result-notice > .fa {
    margin-top: 3px;

    color: #9a7825;
    font-size: 17px;
}

.result-notice p {
    margin: 0;

    font-size: 14px;
    line-height: 1.5;
}

.result-notice strong {
    color: #8a2f25;
    text-transform: uppercase;
}


/* Acciones */

.result-actions {
    padding: 0 30px 28px;

    display: flex;
    justify-content: center;
}


/* =========================================
   LISTADO DE RESULTADOS
========================================= */

.result-list-card {
    max-width: 1050px;
    padding: 28px;
}

.result-header {
    margin-bottom: 24px;

    display: flex;
    align-items: center;
    gap: 15px;
}

.result-header-icon {
    width: 48px;
    height: 48px;

    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;

    background: var(--cal-blue);
    color: var(--cal-white);

    border-radius: 50%;

    font-size: 18px;
}

.result-header h2 {
    margin: 0 0 3px;

    color: var(--cal-blue);

    font-size: 24px;
    font-weight: 700;
}

.result-header p {
    margin: 0;

    color: var(--cal-text-muted);

    font-size: 14px;
}

.result-table-wrapper {
    width: 100%;
    overflow-x: auto;
}

.result-table {
    width: 100% !important;
    margin-bottom: 0 !important;

    border-collapse: separate;
    border-spacing: 0;
}

.result-table thead th {
    padding: 13px 12px !important;

    background: #f4f6f8;
    color: var(--cal-blue);

    border-bottom: 2px solid #dfe3e8 !important;

    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.result-table tbody td {
    padding: 13px 12px !important;

    vertical-align: middle !important;

    border-top: 1px solid #edf0f2 !important;

    color: var(--cal-text);
    font-size: 14px;
}

.result-cal {
    color: var(--cal-blue);
}

.result-table-action {
    text-align: center;
}

.result-view-button {
    padding: 7px 11px;

    display: inline-flex;
    align-items: center;
    gap: 5px;

    background: var(--cal-blue);
    color: var(--cal-white) !important;

    border-radius: 8px;

    font-size: 12px;
    font-weight: 700;
    text-decoration: none !important;
}

.result-view-button:hover,
.result-view-button:focus {
    background: var(--cal-blue-light);
}

/* Sin resultados */

.result-empty {
    padding: 45px 20px;
    text-align: center;
}

.result-empty > .fa {
    margin-bottom: 12px;

    color: #98a2b3;
    font-size: 38px;
}

.result-empty h3 {
    margin: 0 0 7px;

    color: var(--cal-blue);

    font-size: 20px;
    font-weight: 700;
}

.result-empty p {
    margin: 0;

    color: var(--cal-text-muted);
    font-size: 14px;
}

/* =========================================
   RESPONSIVE
========================================= */

@media (max-width: 767px) {

    .cal-header-logo {
        min-height: 95px;
        padding: 15px 20px;
    }

    .logo-cal {
        max-width: 250px;
        max-height: 68px;
    }

    .cal-header-title {
        padding: 25px 18px 15px;
    }

    .cal-header-title h1 {
        font-size: 26px;
    }

    .cal-header-title p {
        font-size: 15px;
    }

    .search-section {
        padding: 18px 15px 35px;
    }

    .search-card {
        padding: 25px 20px;
        border-radius: 16px;
    }

    .search-card-header h2 {
        font-size: 21px;
    }

    .search-actions {
        flex-direction: column;
    }

    .search-button {
        width: 100%;
    }

    .cal-footer {
        padding: 16px 15px;
    }

    .cal-footer p {
        font-size: 13px;
    }
    
    .result-section {
        padding: 18px 15px 35px;
    }
    
    .result-profile-header {
        padding: 25px 20px;
    
        flex-direction: column;
        text-align: center;
    }
    
    .result-photo {
        width: 135px;
        height: 165px;
    }
    
    .result-identity h2 {
        font-size: 22px;
    }
    
    .result-details {
        padding: 20px;
    
        grid-template-columns: 1fr;
    }
    
    .result-notice {
        margin: 0 20px 20px;
    }
    
    .result-actions {
        padding: 0 20px 24px;
    }
    
    .result-list-card {
        padding: 20px 15px;
    }
    
    .result-header h2 {
        font-size: 21px;
    }
}

@media (max-width: 480px) {

    .logo-cal {
        max-width: 220px;
    }

    .cal-header-title h1 {
        font-size: 23px;
    }

    .search-card {
        padding: 22px 17px;
    }

    .search-type-button {
        padding: 12px 14px;
    }

    .search-type-icon {
        width: 40px;
        height: 40px;

        margin-right: 11px;
    }

    .search-type-content strong {
        font-size: 14px;
    }

    .search-type-content small {
        font-size: 12px;
    }

    .search-captcha {
        flex-direction: column;
    }

    .search-captcha-image {
        width: 100%;
    }
}
