/* ============================================================
   condiciones-contratacion.css
   Fichero: Transotel.Web/wwwroot/css/condiciones-contratacion.css
   --------------------------------------------------------------
   Componente de 5 checkboxes obligatorios antes del pago.
   Se usa en:
     - Paso 3 del wizard QR (pedido-nuevo.css lo importa en Nuevo.cshtml)
     - Pagina de link de pago (pago.css lo importa en Link.cshtml)
   Paleta: navy #0B1F3A | teal #008572 | gold #dfbb3e
   Responsive first, accesible (focus visible, tamanos minimos 44px tap).
   ============================================================ */

/* ── WRAPPER PRINCIPAL ────────────────────────────────────── */
.cc-wrapper {
    background: #fffdf4;                        /* amarillo muy suave como la japonesa */
    border: 2px solid #dfbb3e;                  /* gold Transotel */
    border-radius: 14px;
    padding: 1.5rem 1.25rem;
    margin: 1.5rem 0;
    position: relative;
    transition: border-color .25s, box-shadow .25s;
}

.cc-wrapper--error {
    border-color: #dc2626;
    box-shadow: 0 0 0 4px rgba(220, 38, 38, .12);
    animation: cc-shake .35s ease-in-out;
}

@keyframes cc-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-6px); }
    75%      { transform: translateX(6px); }
}

/* ── CABECERA ─────────────────────────────────────────────── */
.cc-header {
    margin-bottom: 1.1rem;
    padding-bottom: .9rem;
    border-bottom: 1px dashed #dfbb3e;
}

.cc-titulo {
    display: flex;
    align-items: center;
    gap: .55rem;
    margin: 0 0 .35rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: #0B1F3A;                             /* navy */
    line-height: 1.3;
}

.cc-titulo .fas {
    color: #008572;                             /* teal */
    font-size: 1.15rem;
    flex-shrink: 0;
}

.cc-subtitulo {
    margin: 0;
    color: #6b7280;
    font-size: .87rem;
    line-height: 1.45;
    padding-left: 1.7rem;                       /* alineado con el texto del titulo */
}

/* ── LISTA DE CHECKBOXES ──────────────────────────────────── */
.cc-lista {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: .65rem;
}

.cc-item {
    background: #ffffff;
    border: 1px solid #f3e8c6;
    border-radius: 10px;
    padding: .9rem 1rem;
    transition: border-color .2s, background .2s, transform .15s;
}

.cc-item:hover {
    border-color: #dfbb3e;
    background: #fffaea;
}

.cc-item--legal {
    background: #f0fdfa;                        /* fondo teal muy suave para legal */
    border-color: #99e5d6;
}

.cc-item--legal:hover {
    background: #ccf5ea;
    border-color: #008572;
}

/* ── LABEL + CHECKBOX PERSONALIZADO ───────────────────────── */
.cc-label {
    display: flex;
    align-items: flex-start;
    gap: .75rem;
    cursor: pointer;
    margin: 0;
    min-height: 44px;                           /* WCAG target size */
    user-select: none;
}

/* Ocultamos el input nativo pero NO con display:none (accesibilidad) */
.cc-checkbox {
    position: absolute;
    opacity: 0;
    width: 22px;
    height: 22px;
    margin: 0;
    cursor: pointer;
}

.cc-box {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border: 2px solid #d1d5db;
    border-radius: 5px;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
    transition: background .2s, border-color .2s, transform .15s;
    position: relative;
}

.cc-box .fas {
    color: #fff;
    font-size: .72rem;
    opacity: 0;
    transform: scale(.5);
    transition: opacity .18s ease-out, transform .18s ease-out;
}

/* Checkbox MARCADO */
.cc-checkbox:checked + .cc-box {
    background: #008572;                        /* teal */
    border-color: #008572;
    transform: scale(1.02);
}

.cc-checkbox:checked + .cc-box .fas {
    opacity: 1;
    transform: scale(1);
}

/* Checkbox con FOCUS (accesibilidad — siempre visible) */
.cc-checkbox:focus-visible + .cc-box {
    outline: 3px solid #dfbb3e;
    outline-offset: 2px;
}

/* Checkbox con HOVER */
.cc-label:hover .cc-box {
    border-color: #008572;
}

.cc-label:hover .cc-checkbox:checked + .cc-box {
    background: #006b5c;
    border-color: #006b5c;
}

/* ── TEXTO DEL CHECKBOX ──────────────────────────────────── */
.cc-text {
    flex: 1;
    color: #1f2937;
    font-size: .92rem;
    line-height: 1.5;
}

/* Estado "ya aceptado" — texto en navy */
.cc-checkbox:checked ~ .cc-text,
.cc-item:has(.cc-checkbox:checked) .cc-text {
    color: #0B1F3A;
    font-weight: 500;
}

/* ── LINKS A TERMINOS / PRIVACIDAD ────────────────────────── */
.cc-link {
    color: #008572;
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: rgba(0, 133, 114, .4);
    text-underline-offset: 2px;
    transition: color .2s, text-decoration-color .2s;
}

.cc-link:hover,
.cc-link:focus-visible {
    color: #006b5c;
    text-decoration-color: #008572;
}

.cc-link:focus-visible {
    outline: 2px solid #dfbb3e;
    outline-offset: 2px;
    border-radius: 2px;
}

/* ── AVISO DE ERROR ───────────────────────────────────────── */
.cc-aviso {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin: 1rem 0 0;
    padding: .8rem 1rem;
    background: #fee2e2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    font-size: .88rem;
    font-weight: 500;
    line-height: 1.4;
}

.cc-aviso[hidden] {
    display: none;
}

.cc-aviso .fas {
    color: #dc2626;
    font-size: 1rem;
    flex-shrink: 0;
}

/* ── BOTON BLOQUEADO (estado visual cuando no se aceptaron todas) ── */
.cc-btn-bloqueado {
    opacity: .55 !important;
    cursor: not-allowed !important;
    filter: grayscale(.35);
    pointer-events: auto !important;            /* queremos click para mostrar aviso */
}

.cc-btn-bloqueado:hover {
    transform: none !important;
}

/* ── RESPONSIVE (movil) ───────────────────────────────────── */
@media (max-width: 520px) {
    .cc-wrapper {
        padding: 1.1rem .9rem;
        margin: 1.2rem 0;
        border-radius: 12px;
    }

    .cc-titulo {
        font-size: .98rem;
    }

    .cc-subtitulo {
        font-size: .82rem;
        padding-left: 0;
    }

    .cc-item {
        padding: .8rem .85rem;
    }

    .cc-text {
        font-size: .88rem;
    }

    .cc-label {
        gap: .65rem;
    }

    .cc-aviso {
        font-size: .85rem;
    }
}

/* ── REDUCED MOTION ───────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .cc-wrapper,
    .cc-item,
    .cc-box,
    .cc-box .fas,
    .cc-checkbox:checked + .cc-box {
        animation: none !important;
        transition: none !important;
    }
}

/* ── DARK COLOR SCHEME (futuro) ───────────────────────────── */
@media (prefers-color-scheme: dark) {
    /* Se mantiene el diseño claro — la web Transotel es light-mode */
}
