/* ==========================================
   IMPORTACIÓN DE FUENTES LOCALES (.TTF)
   ========================================== */

@font-face {
    font-family: 'Druk Wide';
    src: url('../assets/fonts/DRUK/FontsFree-Net-Druk-Wide-Bold.ttf') format('truetype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: 'DIN Next LT Pro';
    src: url('../assets/fonts/DINNEXTPRO/DINNextLTPro-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

/* ==========================================
   ESTILOS GENERALES Y CONTENEDORES ASP.NET
   ========================================== */

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
}

html, body {
    height: 100%;
    min-height: 100vh;
    background-color: #1e1f1f;
    color: #ffffff;
}

/* Adaptación para que el form ASP.NET y UpdatePanel ocupen toda la pantalla */
form#ccc {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    width: 100%;
}

.flex-full {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    width: 100%;
}

/* ==========================================
   HEADER
   ========================================== */

header {
    background-color: #141515;
    padding: 10px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #2d2f2f;
    min-height: 70px;
    height: auto;
}

.logo-placeholder {
    display: flex;
    align-items: center;
}

    .logo-placeholder img {
        max-height: 42px;
        width: auto;
        object-fit: contain;
    }

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================
   MAIN GENERAL (LOGIN / LANDING)
   ========================================== */

main {
    display: flex;
    flex: 1;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    align-items: center;
    gap: 40px;
}

.landing-content {
    font-family: 'Druk Wide', Impact, sans-serif;
    flex: 1;
}

    .landing-content h1 {
        font-weight: bold;
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 20px;
        color: #ffffff;
        text-transform: uppercase;
    }

        .landing-content h1 span {
            color: #ccff33;
        }

    .landing-content p {
        color: #a0a5a5;
        font-size: 1.1rem;
        line-height: 1.6;
    }

.form-container {
    flex: 1;
    background-color: #141515;
    padding: 20px 25px;
    border-radius: 8px;
    border: 1px solid #2d2f2f;
    max-width: 480px;
    width: 100%;
}

    .form-container h2 {
        font-family: 'Druk Wide', Impact, sans-serif;
        font-weight: bold;
        font-size: 1.1rem;
        margin-bottom: 15px;
        text-align: center;
        color: #ffffff;
        text-transform: uppercase;
    }

.form-group {
    margin-bottom: 8px;
}

    .form-group label {
        display: block;
        margin-bottom: 4px;
        font-size: 0.85rem;
        color: #ccff33;
        font-weight: bold;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-family: 'DIN Next LT Pro', Arial, sans-serif;
        font-weight: 500;
        width: 100%;
        padding: 8px 12px;
        background-color: #222323;
        border: 1px solid #3d4040;
        border-radius: 6px;
        color: #ffffff;
        font-size: 0.95rem;
        outline: none;
        transition: border-color 0.2s;
    }

        .form-group input:focus,
        .form-group select:focus,
        .form-group textarea:focus {
            border-color: #ccff33;
        }

    .form-group textarea {
        resize: none;
    }

.hidden {
    display: none !important;
}

.checkbox-group {
    display: grid;
    grid-template-columns: 10% 90%;
    gap: 10px;
    align-items: center;
    padding: 7px;
    justify-content: right;
}

    .checkbox-group:has(input.invalid) {
        border: 1px solid #f97b7b;
        border-radius: 5px;
    }

input.invalid,
select.invalid,
textarea.invalid {
    border: 1px solid #f97b7b;
}

.text-required {
    color: #f97b7b;
    font-size: 0.75rem;
}

.mensaje-fallo {
    display: flex;
    justify-content: center;
    color: palevioletred;
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.lbl-required::after {
    content: "*";
    color: #f97b7b;
    font-weight: bold;
    padding-left: 4px;
}

/* ==========================================
   BOTONES
   ========================================== */

.btn-submit {
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
    font-weight: bold;
    width: 100%;
    padding: 12px;
    background-color: #ccff33;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    margin-top: 5px;
}

    .btn-submit:hover {
        background-color: #b5e62d;
    }

.btn-action {
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
    font-weight: bold;
    display: inline-block;
    text-decoration: none;
    width: 100%;
    padding: 14px;
    background-color: #ccff33;
    color: #000000;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

    .btn-action:hover {
        background-color: #b5e62d;
    }

.btn-qr,
.btn-listReferidos {
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
    font-weight: bold;
    background-color: #ccff33;
    color: #000000;
    border: none;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.2s;
}

    .btn-qr:hover,
    .btn-listReferidos:hover {
        background-color: #b5e62d;
    }

.btn-logout {
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
    font-weight: bold;
    background-color: transparent;
    color: #a0a5a5;
    border: 1px solid #3d4040;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

    .btn-logout:hover {
        color: #ffffff;
        border-color: #ffffff;
    }


.btn-estados {
    font-family: 'DIN Next LT Pro', Arial, sans-serif;
    font-weight: bold;
    background-color: transparent;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 6px;
    padding: 9px 14px;
    font-size: 0.9rem;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

    .btn-estados:hover {
        color: #999;
        border-color: #999;
    }

/* ==========================================
   GRILLA / REPEATER (DESKTOP)
   ========================================== */

main.grid-main {
    display: block !important;
    max-width: 95% !important;
    width: 95% !important;
    margin: 30px auto !important;
    padding: 0 !important;
    align-items: flex-start !important;
}

.grid-container {
    background-color: #141515;
    border: 1px solid #2d2f2f;
    border-radius: 8px;
    padding: 25px 30px;
    width: 100%;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.grid-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    border-bottom: 1px solid #2d2f2f;
    padding-bottom: 15px;
}

    .grid-header h2 {
        font-family: 'Druk Wide', Impact, sans-serif;
        font-weight: bold;
        font-size: 1.3rem;
        color: #ffffff;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.data-table,
.table-referidos {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    text-align: center;
}

    .data-table thead tr,
    .table-referidos thead tr {
        background-color: #1a1b1b;
    }

    .data-table th,
    .table-referidos th {
        padding: 16px 14px;
        color: #ccff33;
        font-family: 'DIN Next LT Pro', Arial, sans-serif;
        font-weight: bold;
        font-size: 0.9rem;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        border-bottom: 2px solid #2d2f2f;
        white-space: nowrap;
    }

    .data-table td,
    .table-referidos td {
        padding: 16px 14px;
        color: #ffffff;
        font-size: 0.95rem;
        border-bottom: 1px solid #222323;
        white-space: nowrap;
    }

    .data-table tbody tr {
        transition: background-color 0.2s;
    }

        .data-table tbody tr:hover {
            background-color: #1f2020;
        }

/* En Desktop ocultamos los elementos del acordeón móvil */
.card-main-row,
.toggle-card,
.card-trigger .chevron {
    display: none !important;
}

/* ==========================================
   BADGES DE ESTADOS (Mapeo dinámico del Repeater)
   ========================================== */

.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}


    /* Referido */
    .status-badge.status-referido {
        background-color: rgba(255, 255, 255, 0.2);
        color: #ffffff;
        border: 1px solid #CCC;
    }

    /* Asignado */
    .status-badge.status-asignado {
        background-color: rgba(0, 139, 139, 0.2);
        color: #00e1e1;
        border: 1px solid #008b8b;
    }

    /* Finalizado */
    .status-badge.status-finalizado {
        background-color: rgba(255, 255, 255, 0.05);
        color: #999999;
        border: 1px solid #999999;
    }

    /* Presupuesto */
    .status-badge.status-presupuesto {
        background-color: rgb(139 88 0 / 20%);
        color: #e19300;
        border: 1px solid #8b5900;
    }

    /* Preventa y Suscripcion */
    .status-badge.status-preventa,
    .status-badge.status-suscripcion {
        background-color: rgba(0, 140, 0, 0.2);
        color: #00AA00;
        border: 1px solid #00AA00;
    }

    /* Entregado */
    .status-badge.status-entregado {
        background-color: rgba(204, 255, 51, 0.15);
        color: #ccff33;
        border: 1px solid #ccff33;
    }

/* ==========================================
   MODAL DE QR
   ========================================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

    .modal-overlay.active {
        display: flex;
    }

.modal-content {
    background-color: #141515;
    border: 1px solid #2d2f2f;
    border-radius: 8px;
    padding: 30px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: #a0a5a5;
    font-size: 1.8rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s;
}

    .modal-close:hover {
        color: #ccff33;
    }

.modal-content h2 {
    font-family: 'Druk Wide', Impact, sans-serif;
    font-size: 1.2rem;
    color: #ffffff;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.modal-content p {
    color: #a0a5a5;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
}

.qr-wrapper {
    background-color: #ffffff;
    padding: 15px;
    border-radius: 6px;
    display: inline-block;
    margin-bottom: 20px;
}

    .qr-wrapper img {
        display: block;
        width: 185px;
        height: 185px;
    }

.link-box {
    display: flex;
    gap: 8px;
}

    .link-box input {
        flex: 1;
        padding: 10px 12px;
        background-color: #222323;
        border: 1px solid #3d4040;
        border-radius: 6px;
        color: #ffffff;
        font-size: 0.85rem;
        outline: none;
    }

    .link-box button {
        font-family: 'DIN Next LT Pro', Arial, sans-serif;
        font-weight: bold;
        background-color: #ccff33;
        color: #000000;
        border: none;
        border-radius: 6px;
        padding: 0 15px;
        font-size: 0.85rem;
        cursor: pointer;
        transition: background-color 0.2s;
    }

        .link-box button:hover {
            background-color: #b5e62d;
        }


/* ==========================================
   MODAL DE ESTADOS
   ========================================== */

.claseEstados {
    display: grid;
    row-gap: 20px;
}


.claseEst {
    display: grid;
    row-gap: 5px;
}


/* ==========================================
   VISTAS AUXILIARES (ERROR / ÉXITO / REGISTRADO)
   ========================================== */

.error-main,
.success-main,
.registered-main {
    display: flex;
    flex: 1;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.error-container,
.success-container,
.registered-container {
    background-color: #141515;
    padding: 40px 30px;
    border-radius: 8px;
    border: 1px solid #2d2f2f;
    max-width: 500px;
    width: 100%;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.error-icon,
.success-icon {
    font-size: 3.5rem;
    color: #ccff33;
    margin-bottom: 20px;
}

.registered-icon {
    font-size: 3.5rem;
    color: red;
    margin-bottom: 20px;
}

.error-container h1,
.success-container h1,
.registered-container h1 {
    font-family: 'Druk Wide', Impact, sans-serif;
    font-weight: bold;
    font-size: 1.3rem;
    margin-bottom: 15px;
    color: #ffffff;
    text-transform: uppercase;
}

.error-container p,
.registered-container p {
    color: #a0a5a5;
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.success-container p {
    color: #a0a5a5;
    font-size: 1.1rem;
    line-height: 1.6;
}

/* ==========================================
   RESPONSIVE MOBILE (PANTALLAS CHICAS)
   ========================================== */

@media (max-width: 768px) {
    header {
        padding: 12px 16px;
        flex-direction: column;
        gap: 12px;
        height: auto !important;
    }

    .logo-placeholder {
        width: 100%;
        justify-content: center;
    }

        .logo-placeholder img {
            max-height: 34px;
        }

    .header-actions {
        width: 100%;
        display: flex;
        gap: 10px;
    }

    .btn-qr,
    .btn-listReferidos,
    .btn-logout {
        flex: 1;
        padding: 10px 8px;
        font-size: 0.85rem;
        text-align: center;
    }

    main {
        flex-direction: column;
        padding: 20px 10px;
    }

    .landing-content {
        text-align: center;
    }

    .form-container {
        max-width: 100%;
    }

    /* Grilla a Tarjetas Desplegables */
    main.grid-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 15px auto !important;
        padding: 0 10px !important;
    }

    .grid-container {
        padding: 15px;
    }

    .grid-header h2 {
        font-size: 1rem;
        text-align: center;
    }

    .data-table thead,
    .table-referidos thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td,
    .table-referidos,
    .table-referidos tbody,
    .table-referidos tr,
    .table-referidos td {
        display: block;
        width: 100%;
    }

        .data-table tbody tr,
        .table-referidos tbody tr {
            background-color: #141515;
            border: 1px solid #2d2f2f;
            border-radius: 8px;
            margin-bottom: 12px;
            overflow: hidden;
            transition: border-color 0.2s;
        }

    /* 1. Header del acordeón visible */
    .card-main-row {
        display: block !important;
        padding: 0 !important;
        border-bottom: none !important;
    }

    .card-summary {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 14px 15px;
        background-color: #1a1b1b;
        cursor: pointer;
        user-select: none;
    }

    .summary-info {
        display: flex;
        flex-direction: column;
        gap: 3px;
        text-align: left;
    }

    .summary-name {
        color: #ffffff;
        font-size: 0.95rem;
    }

    .summary-date {
        color: #a0a5a5;
        font-size: 0.75rem;
    }

    .summary-badge {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .card-summary .chevron {
        font-size: 0.7rem;
        color: #ccff33;
        transition: transform 0.25s ease;
    }

    /* 2. Filas de detalle colapsadas */
    .card-detail {
        display: none !important;
        justify-content: space-between;
        align-items: center;
        padding: 10px 15px;
        border-bottom: 1px solid #222323;
        font-size: 0.85rem;
        text-align: right;
        background-color: #141515;
    }

        .card-detail:last-child {
            border-bottom: none;
        }

        .card-detail::before {
            content: attr(data-label);
            font-family: 'DIN Next LT Pro', Arial, sans-serif;
            font-weight: bold;
            color: #ccff33;
            text-transform: uppercase;
            font-size: 0.75rem;
            margin-right: 15px;
            flex-shrink: 0;
            text-align: left;
        }

    /* 3. Despliegue al tocar */
    tr:has(.toggle-card:checked) {
        border-color: #3d4520;
    }

        tr:has(.toggle-card:checked) .card-summary {
            border-bottom: 1px solid #2d2f2f;
        }

            tr:has(.toggle-card:checked) .card-summary .chevron {
                transform: rotate(180deg);
            }

        tr:has(.toggle-card:checked) .card-detail:not(.hide-mobile) {
            display: flex !important;
            animation: slideDown 0.2s ease-in;
        }

        /* Ocultar el estado interno duplicado en mobile */
        .hide-mobile,
        tr:has(.toggle-card:checked) .card-detail.hide-mobile,
        tr:has(.toggle-card:checked) td[data-label="Estado"] {
            display: none !important;
        }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}
