/* =============================================================================
   order-pay.css — página pública de pago de un pedido (pub/pay.php, /pay/<token>).

   Chasis de la página (fondo, tarjeta, cabecera, identidad, direcciones del
   dueño). El formulario y el resumen reutilizan las clases .sas-checkout-* de
   landing-checkout.css. Paleta alineada con pub/landing_inactive.php.
   ========================================================================== */

:root {
    --op-ink: #233246;
    --op-muted: #6a7a8f;
    --op-accent: #1f7ae0;
    --op-border: #e3e9f1;
    --op-bg: #f4f7fb;
    --op-card: #ffffff;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, Tahoma, Arial, sans-serif;
    color: var(--op-ink);
    background: linear-gradient(180deg, #eef3fa 0%, var(--op-bg) 100%);
    line-height: 1.55;
    min-height: 100vh;
    padding: 28px 16px 40px;
}

.op-wrap {
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
}

.op-logo {
    color: var(--op-accent);
    font-size: 48px;
    line-height: 1;
    text-align: center;
    margin-bottom: 20px;
}
.op-logo svg { width: auto; height: 1em; }

.op-card {
    background: var(--op-card);
    border: 1px solid var(--op-border);
    border-radius: 18px;
    padding: 30px 28px 28px;
    box-shadow: 0 14px 40px rgba(31, 74, 120, .10);
}
@media (max-width: 480px) {
    .op-card { padding: 22px 16px 20px; }
}

.op-card h1 {
    font-size: 22px;
    font-weight: 700;
    margin: 0 0 4px;
}
/* Tarjetas de aviso (enlace inválido, pedido pagado, no disponible): centradas
   y estrechas, como pub/landing_inactive.php. */
.op-card--notice {
    max-width: 460px;
    margin: 0 auto;
    text-align: center;
    padding-top: 36px;
    padding-bottom: 34px;
}
.op-orderref {
    color: var(--op-muted);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin: 0 0 18px;
}
.op-sub { color: var(--op-muted); font-size: 15px; margin: 0 0 6px; }

/* --- Identidad (modo invitado) ---------------------------------------------- */
.op-identify {
    border: 1px solid var(--op-border);
    border-radius: 12px;
    background: #f8fafd;
    padding: 16px 18px;
    margin-bottom: 20px;
}
.op-for { margin: 0 0 10px; font-size: 15px; }
.op-notyou { color: var(--op-muted); font-size: 13px; }
.op-login {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 14px;
    margin-bottom: 6px;
}
.op-hint { color: var(--op-muted); font-size: 12.5px; margin: 4px 0 0; }
.op-continue { font-weight: 600; font-size: 14px; margin: 12px 0 0; }

.op-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}
.op-btn-outline {
    color: var(--op-accent);
    border: 2px solid var(--op-border);
    background: #fff;
}
.op-btn-outline:hover { border-color: var(--op-accent); background: #f2f7fe; }
.op-btn-ghost {
    color: var(--op-muted);
    border: 0;
    background: transparent;
    text-decoration: underline;
}
.op-btn-ghost:hover { color: var(--op-ink); }

/* --- Direcciones del dueño ---------------------------------------------------- */
.op-addresses { border: 1px solid var(--op-border); border-radius: 10px; padding: 18px; margin: 0 0 20px; }
.op-addresses legend { font-weight: 700; font-size: 15px; padding: 0 8px; }
.op-address {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--op-border);
    border-radius: 8px;
    margin-bottom: 8px;
    cursor: pointer;
}
.op-address:has(input:checked) { border-color: var(--op-accent); background: #f3f8ff; }
.op-address input { margin-top: 4px; }
.op-address-body { min-width: 0; }
.op-address-title { display: block; font-weight: 600; font-size: 14px; }
.op-address-line { display: block; color: var(--op-muted); font-size: 13px; overflow-wrap: anywhere; }
.op-badge {
    display: inline-block;
    font-style: normal;
    font-size: 11px;
    font-weight: 700;
    color: #1f7a4d;
    background: #e7f5ee;
    border-radius: 6px;
    padding: 1px 7px;
    margin-left: 6px;
    vertical-align: middle;
}

/* El resumen va arriba, con un pelín más de aire que en la landing. */
.op-summary { margin-bottom: 20px; }

/* --- Confirmación (vuelta del pago) ------------------------------------------- */
#op-confirm { text-align: center; padding: 12px 0 6px; }
.op-spinner {
    width: 34px;
    height: 34px;
    margin: 18px auto 6px;
    border: 3px solid var(--op-border);
    border-top-color: var(--op-accent);
    border-radius: 50%;
    animation: op-spin .9s linear infinite;
}
/* Variante inline (junto al texto "esperando a que inicies sesión"). */
.op-spinner-sm {
    display: inline-block;
    width: 13px;
    height: 13px;
    margin: 0 4px -2px 0;
    border-width: 2px;
}
.op-waiting { color: var(--op-accent); }
@keyframes op-spin { to { transform: rotate(360deg); } }

.op-footer {
    margin-top: 18px;
    text-align: center;
    color: var(--op-muted);
    font-size: 12px;
}

/* Producto incluido (regalo de 0 € del pedido, Billing.md §57.12): bajo el principal, más discreto. */
.sas-checkout-included { margin-top: -6px; }
.sas-checkout-included strong { font-size: 15px; font-weight: 600; }

/* --- Métodos de pago (Billing.md §64) --------------------------------------
   Selector solo con más de un método; las tarjetas .sas-checkout-method vienen de
   landing-checkout.css. */
.op-methods { border: 1px solid var(--op-border); border-radius: 10px; padding: 14px 18px 8px; margin: 0 0 20px; }
.op-methods legend { font-weight: 700; font-size: 15px; padding: 0 8px; }
.op-methods .sas-checkout-method span { font-size: 14px; }

/* Transferencia ya elegida (revisita del enlace): la caja de instrucciones arriba,
   con la pista de que debajo sigue el formulario para pagar de otra forma. */
.op-bankwire-pending { margin-bottom: 20px; }
.op-bankwire-pending h3 { font-size: 17px; }
.op-bankwire-other { margin: 14px 0 0; font-weight: 600; font-size: 14px; }
/* Datos del banco del texto del método «transferencia» (sin CONFIG_BANKWIRE_IBAN). */
.op-bankwire-info { margin-top: 12px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.op-bankwire-info p { margin: 0 0 4px; }
.op-no-methods { display: block; }

/* Vuelta KO del TPV: aviso centrado con el botón de reintentar. */
.op-retry { text-align: center; padding: 12px 0 6px; }
.op-retry p:last-child { margin-top: 16px; }

/* --- seQura (Billing.md §66) ------------------------------------------------
   Email del que paga (solo invitado y solo con seQura elegido), elección del producto
   cuando la solicitud ofrece varios y aviso de financiación en revisión. El formulario
   de seQura es un iframe a pantalla completa que inserta js/sequra.js. */
.op-sequra-email { margin-top: -8px; }
.op-sequra { margin-top: 16px; }
.op-sequra h3 { font-size: 17px; margin: 0 0 10px; }
.op-sequra-products { display: flex; flex-direction: column; gap: 8px; }
.op-sequra-product small { display: block; color: var(--op-muted); font-size: 12.5px; }
.op-sequra-status { color: var(--op-muted); font-size: 14px; margin: 10px 0 0; }
.op-sequra-continue { margin-top: 12px; }
.op-sequra-review { display: block; margin-bottom: 20px; }
#sas-sequra-form { position: relative; z-index: 999999; }
