/* ==========================================================================
   Confirmación de Reserva — controles compartidos
   Design System: .claude/DESIGN-SYSTEM.md

   Es GLOBAL y no CSS isolation, con el mismo criterio que chat-components.css:
   estos controles los comparten la página y sus dos grillas, y con isolation
   habría que repetir la misma definición en tres archivos. El layout propio de
   cada componente sí vive en su .razor.css.
   ========================================================================== */

/* Altura ÚNICA de control. Los campos y el botón de quitar viven en la misma
   fila de una grilla: con alturas calculadas por separado (padding + fuente +
   borde) quedan desalineados por dos o tres píxeles, que es lo que se ve. */
.bc-input,
.bc-btn {
    --bc-control-h: 38px;
    min-height: var(--bc-control-h);
    box-sizing: border-box;
}

/* ---------- Botones ---------- */

.bc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--rame-space-2, 8px);
    padding: var(--rame-space-2, 8px) var(--rame-space-4, 16px);
    border: 1px solid var(--rame-border-medium, #d0d3d9);
    border-radius: var(--rame-radius-md, 6px);
    background: var(--rame-bg-primary, #ffffff);
    color: var(--rame-text-primary, #1c1e21);
    font-family: var(--rame-font-family);
    font-size: var(--rame-text-base, 13px);
    font-weight: var(--rame-font-medium, 500);
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.bc-btn:hover:not(:disabled) {
    background: var(--rame-bg-secondary, #f7f8fa);
    border-color: var(--rame-border-medium, #d0d3d9);
}

.bc-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.bc-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.bc-btn:focus-visible {
    outline: 2px solid var(--rame-primary, #0084ff);
    outline-offset: 2px;
}

.bc-btn--primary {
    background: linear-gradient(135deg, var(--rame-primary, #0084ff) 0%, var(--rame-primary-hover, #0073e6) 100%);
    border-color: transparent;
    color: #ffffff;
    font-weight: var(--rame-font-semibold, 600);
}

.bc-btn--primary:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--rame-primary-hover, #0073e6) 0%, var(--rame-primary, #0084ff) 100%);
    box-shadow: var(--rame-shadow-primary, 0 2px 8px rgba(0, 132, 255, 0.35));
    transform: translateY(-1px);
}

/* La acción que SACA el documento del sistema: enviar, o dar por enviado. Verde
   y no azul para separarla de "Descargar PDF", que no le llega a nadie. */
.bc-btn--success {
    background: var(--rame-success, #0A8368);
    border-color: transparent;
    color: #ffffff;
    font-weight: var(--rame-font-semibold, 600);
}

.bc-btn--success:hover:not(:disabled) {
    background: var(--rame-success-hover, #086B55);
    transform: translateY(-1px);
}

.bc-btn--ghost {
    background: transparent;
    border-color: var(--rame-border-light, #e4e6eb);
    color: var(--rame-text-secondary, #65676b);
}

.bc-btn--ghost:hover:not(:disabled) {
    background: var(--rame-bg-tertiary, #f0f2f5);
    color: var(--rame-text-primary, #1c1e21);
}

/* Quitar una fila. Sin borde en reposo: es una acción secundaria y destructiva,
   y un cuadrado con marco en cada fila compite con los campos que sí importan.
   Se pinta de rojo recién al pasar por encima. */
.bc-btn--icon {
    width: var(--bc-control-h, 38px);
    height: var(--bc-control-h, 38px);
    min-height: var(--bc-control-h, 38px);
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: var(--rame-text-muted, #b0b3b8);
    font-size: var(--rame-text-lg, 15px);
    line-height: 1;
}

.bc-btn--icon:hover:not(:disabled) {
    background: var(--rame-error-light, #FDEBEF);
    border-color: var(--rame-error-border, #F6C2CC);
    color: var(--rame-error, #C0304A);
}

.bc-btn--icon:disabled {
    opacity: 0;          /* en solo lectura no hay nada que quitar: se va del todo */
    pointer-events: none;
}

/* ---------- Campos ---------- */

.bc-input {
    width: 100%;
    min-width: 0;
    padding: var(--rame-space-2, 8px) var(--rame-space-3, 12px);
    border: 1px solid var(--rame-border-light, #e4e6eb);
    border-radius: var(--rame-radius-md, 6px);
    background: var(--rame-bg-primary, #ffffff);
    color: var(--rame-text-primary, #1c1e21);
    font-family: var(--rame-font-family);
    font-size: var(--rame-text-base, 13px);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.bc-input::placeholder {
    color: var(--rame-text-muted, #b0b3b8);
}

.bc-input:focus {
    outline: none;
    border-color: var(--rame-primary, #0084ff);
    box-shadow: 0 0 0 3px var(--rame-primary-lighter, rgba(0, 132, 255, 0.12));
}

.bc-input:disabled {
    background: var(--rame-bg-tertiary, #f0f2f5);
    color: var(--rame-text-muted, #b0b3b8);
    cursor: not-allowed;
}

/* ---------- Fecha ----------
   El input de fecha nativo trae un iconito gris que además es el ÚNICO punto
   que abre el calendario: hay que apuntarle a 16 píxeles. Acá el indicador se
   estira sobre todo el campo y se vuelve invisible, así que cliquear en
   cualquier lado lo abre, y el ícono se dibuja de fondo con el color de marca. */

.bc-input[type="date"] {
    position: relative;
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%230084ff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right var(--rame-space-3, 12px) center;
    padding-right: var(--rame-space-8, 32px);
}

.bc-input[type="date"]::-webkit-calendar-picker-indicator {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
}

.bc-input[type="date"]::-webkit-inner-spin-button,
.bc-input[type="date"]::-webkit-clear-button {
    display: none;
}

/* ---------- Ancla de sección ----------
   Mismo look que `.qb__anchors button` del cotizador, replicado acá porque aquél
   vive en un .razor.css con CSS isolation: nuestros botones se renderizan en el
   árbol del builder pero llevan OTRO scope, así que jamás recibirían ese estilo. */

.bc-anchor {
    padding: 6px 11px;
    border: none;
    border-radius: 7px;
    background: none;
    color: var(--rame-text-secondary, #65676b);
    font-family: var(--rame-font-family);
    font-size: 11px;
    font-weight: var(--rame-font-semibold, 600);
    cursor: pointer;
    transition: all .15s;
}

.bc-anchor:hover {
    background: color-mix(in srgb, var(--rame-primary, #0084ff) 9%, transparent);
    color: var(--rame-primary, #0084ff);
}

/* ---------- Acciones en el rail sticky ---------- */

.bc-rail-actions {
    display: flex;
    flex-direction: column;
    gap: var(--rame-space-2, 8px);
    padding-bottom: var(--rame-space-3, 12px);
    border-bottom: 1px solid var(--rame-border-light, #e4e6eb);
    margin-bottom: var(--rame-space-3, 12px);
}

.bc-rail-actions .bc-btn {
    width: 100%;
}

/* Por qué el botón dice "Marcar como enviada" y no "Enviar": sin esto el vendedor
   se queda esperando que el sistema la mande. */
.bc-rail-hint {
    margin: 0;
    font-size: var(--rame-text-xs, 10px);
    color: var(--rame-text-muted, #b0b3b8);
    line-height: 1.45;
}

.bc-rail-badge {
    padding: var(--rame-space-1, 4px) var(--rame-space-3, 12px);
    border: 1px solid var(--rame-border-light, #e4e6eb);
    border-radius: var(--rame-radius-xl, 10px);
    background: var(--rame-bg-secondary, #f7f8fa);
    font-size: var(--rame-text-xs, 10px);
    color: var(--rame-text-secondary, #65676b);
    text-align: center;
}

/* ---------- Avisos ---------- */

.bc-alert {
    padding: var(--rame-space-2, 8px) var(--rame-space-3, 12px);
    border-radius: var(--rame-radius-md, 6px);
    font-size: var(--rame-text-base, 13px);
    line-height: 1.45;
}

.bc-alert--error {
    background: var(--rame-error-light, #FDEBEF);
    border: 1px solid var(--rame-error-border, #F6C2CC);
    color: var(--rame-error-text, #9C2439);
}

.bc-alert--ok {
    background: var(--rame-success-light, #E3FAF3);
    border: 1px solid var(--rame-success, #0A8368);
    color: var(--rame-success-dark, #065846);
}

/* ========== DARK MODE ========== */

[data-rame-theme="dark"] .bc-btn {
    background: var(--rame-bg-secondary, #282828);
    border-color: var(--rame-border-medium, #505050);
    color: var(--rame-text-primary, #f0f0f0);
}

[data-rame-theme="dark"] .bc-btn:hover:not(:disabled) {
    background: var(--rame-bg-tertiary, #333333);
}

[data-rame-theme="dark"] .bc-btn--primary,
[data-rame-theme="dark"] .bc-btn--success {
    border-color: transparent;
    color: #ffffff;
}

/* En oscuro el verde tinta es ilegible: el token de dark ya trae la versión clara. */
[data-rame-theme="dark"] .bc-btn--success {
    background: var(--rame-success, #2CE0B4);
    color: #05231c;
}

[data-rame-theme="dark"] .bc-btn--ghost {
    background: transparent;
    border-color: var(--rame-border-medium, #505050);
    color: var(--rame-text-secondary, #c8c8c8);
}

[data-rame-theme="dark"] .bc-input {
    background: var(--rame-bg-secondary, #282828);
    border-color: var(--rame-border-medium, #505050);
    color: var(--rame-text-primary, #f0f0f0);
}
