/* ==============================
   Estilos reserva de turno
   ============================== */

:root {
    --reserva-radius-xl: 1.25rem;
    --reserva-radius: 0.9rem;
    --reserva-radius-sm: 0.65rem;
    --reserva-shadow-soft: 0 18px 38px rgba(15, 23, 42, 0.22);

    /* Paleta principal */
    --reserva-primary: #1d4ed8;          /* Azul intenso */
    --reserva-primary-soft: rgba(37, 99, 235, 0.14);
    --reserva-primary-strong: #0f172a;   /* Negro/azul bien oscuro */
    --reserva-accent-green: #22c55e;     /* Verde vivo */
    --reserva-accent-celeste: #0ea5e9;   /* Celeste */
    --reserva-border-soft: rgba(148, 163, 184, 0.6);
}

/* Contenedor de la página de turnos (dentro de main.container de base.html) */
.reserva-page {
    padding: 2.5rem 0 3rem 0;
    display: flex;
    justify-content: center;
}

.reserva-shell {
    width: 100%;
    max-width: 980px;
    border-radius: 1.5rem;
    padding: 2.25rem 1.4rem 2.6rem;

    /* Fondo claro con toques celestes */
    background:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.35) 0, rgba(255, 255, 255, 0.95) 45%, #ffffff 100%);
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    border: 1px solid rgba(148, 163, 184, 0.28);
}

@media (min-width: 768px) {
    .reserva-shell {
        padding-inline: 3rem;
    }
}

/* Títulos */
.titulo-reserva {
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    font-size: 1.35rem;
    color: #020617; /* negro casi puro */
}

.subtitulo-reserva {
    font-size: 0.95rem;
    max-width: 34rem;
    margin: 0 auto;
    color: #4b5563 !important;
}

.tracking-wide {
    letter-spacing: 0.18em;
    font-size: 0.72rem;
    color: #64748b;
}

/* Card principal */
.card-reserva {
    border-radius: var(--reserva-radius-xl);
    box-shadow: var(--reserva-shadow-soft);
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, 0.4);
}

/* Header de la card: azul oscuro ↔ celeste */
.card-reserva .card-header {
    background: linear-gradient(135deg, #020617, #1d4ed8, #0ea5e9);
    color: #e5e7eb;
    border-color: rgba(148, 163, 184, 0.45);
}

.card-reserva .card-header h2 {
    font-weight: 600;
}

.card-reserva .card-subtitle {
    color: #e5e7eb !important;
    opacity: 0.9;
}

/* Badge Paso 1 de 1 */
.reserva-step-badge {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.96);
    border: 1px solid rgba(148, 163, 184, 0.9);
    color: #f9fafb;
}

/* Labels / inputs */
.form-label {
    font-size: 0.88rem;
    margin-bottom: 0.2rem;
    color: #020617;
}

input.form-control,
select.form-select {
    font-size: 0.94rem;
    border-radius: 0.6rem;
    border-color: rgba(148, 163, 184, 0.6);
    transition: box-shadow 0.15s ease, border-color 0.15s ease;
}

/* Estados de enfoque accesibles */
.form-control:focus,
.form-select:focus {
    box-shadow: 0 0 0 0.16rem var(--reserva-primary-soft);
    border-color: var(--reserva-primary);
}

/* Texto de ayuda */
.form-text {
    font-size: 0.78rem;
    color: #6b7280;
}

/* Alertas (mensajes Django) */
.alert {
    border-radius: 0.8rem;
    font-size: 0.85rem;
    border-width: 1px;
}

/* success/info/warning/danger con paleta más llamativa */
.alert-success {
    background: #ecfdf3;
    border-color: #22c55e;
    color: #166534;
}

.alert-info {
    background: #eff6ff;
    border-color: #1d4ed8;
    color: #1d4ed8;
}

.alert-warning {
    background: #fef9c3;
    border-color: #facc15;
    color: #92400e;
}

.alert-danger {
    background: #fef2f2;
    border-color: #ef4444;
    color: #b91c1c;
}

/* Errores de campo */
.text-danger {
    color: #b91c1c !important;
}

/* Botón principal */
.reserva-submit-btn {
    border-radius: 999px;
    font-weight: 700;
    padding: 0.65rem 2.8rem;
    background: #ffffff;                          /* 👈 fondo blanco */
    color: var(--reserva-primary-strong);         /* texto oscuro */
    border: 2px solid var(--reserva-primary);     /* borde azul */
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.20);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.reserva-submit-btn:hover,
.reserva-submit-btn:focus {
    background: var(--reserva-primary);           /* azul al pasar el mouse */
    color: #ffffff;
    transform: translateY(-1px);
    filter: none;
}

/* Punto de estado de horarios */
.reserva-status-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
    background-color: transparent;
    border: 1px solid transparent;
}

.reserva-status-dot-ok {
    background-color: #22c55e;
    border-color: rgba(34, 197, 94, 0.6);
}

.reserva-status-dot-loading {
    background-color: #facc15;
    border-color: rgba(250, 204, 21, 0.8);
    animation: reserva-pulse 1s infinite ease-in-out;
}

@keyframes reserva-pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.3);
        opacity: 0.5;
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}

/* Pantalla de confirmación (usa misma estética) */
.turno-confirmacion-card {
    border-radius: var(--reserva-radius-xl);
    box-shadow: var(--reserva-shadow-soft);
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), #ffffff);
}

.turno-confirmacion-icon {
    width: 64px;
    height: 64px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at 30% 30%, #22c55e, #16a34a);
    color: #fff;
    font-size: 2rem;
    margin-bottom: 1rem;
    box-shadow: 0 12px 22px rgba(22, 163, 74, 0.35);
}

.turno-confirmacion-check {
    display: inline-block;
    transform: translateY(-1px);
}

/* Mobile */
@media (max-width: 575.98px) {
    .reserva-shell {
        padding: 1.6rem 1rem 2.1rem;
        border-radius: var(--reserva-radius);
    }

    .card-reserva,
    .turno-confirmacion-card {
        border-radius: var(--reserva-radius);
        box-shadow: none;
    }

    .titulo-reserva {
        font-size: 1.15rem;
    }
}

/* Línea de mensaje junto al botón de confirmar */
.reserva-actions {
    border-top: 1px dashed rgba(148, 163, 184, 0.55);
    padding-top: 1rem;
    margin-top: 1.5rem;
}

.reserva-hora-msg {
    font-size: 0.85rem;
    color: #111827;
}

/* En mobile, que el texto quede arriba y el botón abajo */
@media (max-width: 575.98px) {
    .reserva-actions {
        align-items: stretch !important;
    }
    .reserva-hora-msg {
        margin-bottom: 0.4rem;
        text-align: center;
    }
}


/* Errores generales del formulario */
.form-errors-global {
    border-radius: 0.9rem;
    border: 1px solid #ef4444;
    background: #fef2f2;
    color: #991b1b;
    padding: 0.8rem 1rem;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Mensaje de error específico para dominio via JS */
.dominio-error-msg {
    font-size: 0.85rem;
    color: #b91c1c;
}

/* Input con error */
input.is-invalid {
    border-width: 2px;
}

/* Campos deshabilitados por dominio bloqueado */
.reserva-field-disabled {
    background-color: #f3f4f6 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

input.is-invalid,
select.is-invalid {
    border-width: 2px;
}

/* Campo con error: resalta label e input/select */
.field-error .form-label {
    color: #b91c1c;
}


.field-error .form-control,
.field-error .form-select {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 0.15rem rgba(220, 53, 69, .25);
}


/* Ul de errores de Django más prolijo */
ul.errorlist {
    margin: 0;
    padding-left: 0;
    list-style: none;
    font-size: 0.82rem;
    color: #b91c1c;
}



/* ==============================
   Planilla de turnos (backoffice)
   ============================== */

/* Que aproveche mejor el ancho en desktop */
.turnos-planilla-shell {
    max-width: 1360px;
}

/* Cards de cada línea: bordes suaves y radios moderados */
.turnos-planilla-card {
    border-radius: 0.75rem;
    border-color: #e5e7eb;
}

/* Tabla compacta tipo planilla */
.turnos-planilla-table th,
.turnos-planilla-table td {
    padding: 0.35rem 0.45rem;
    font-size: 0.9rem;
}

/* Encabezado gris claro similar al PDF */
.turnos-planilla-table thead th {
    background-color: #e5e7eb;
    border-bottom-width: 1px;
    font-weight: 600;
}

/* Zebra: una blanca, una celeste cálido */
.turnos-planilla-table tbody tr:nth-child(odd) {
    background-color: #ffffff;
}

.turnos-planilla-table tbody tr:nth-child(even) {
    /* celeste suave / cálido */
    background-color: #e0f2fe;
}

/* Hover sutil para facilitar lectura en pantalla */
.turnos-planilla-table tbody tr:hover {
    background-color: #bfdbfe;
}

/* Ajuste de anchos de columnas para que el vehículo tenga aire */
.turnos-planilla-table th:nth-child(1),
.turnos-planilla-table td:nth-child(1) {
    width: 4.5rem;      /* Hora */
}

.turnos-planilla-table th:nth-child(2),
.turnos-planilla-table td:nth-child(2) {
    width: 6rem;        /* Dominio */
}

.turnos-planilla-table th:nth-child(3),
.turnos-planilla-table td:nth-child(3) {
    width: 12rem;       /* Vehículo (más ancho) */
}

.turnos-planilla-table th:nth-child(4),
.turnos-planilla-table td:nth-child(4) {
    width: 6.5rem;      /* DNI */
}

.turnos-planilla-table th:nth-child(6),
.turnos-planilla-table td:nth-child(6) {
    width: 7.5rem;      /* Teléfono */
}

/* Que el correo pueda cortar línea si es muy largo */
.turnos-planilla-table td:nth-child(7) {
    word-break: break-all;
}

/* Responsive: en móviles ajustamos padding y fuente */
@media (max-width: 575.98px) {
    .turnos-planilla-shell {
        padding-inline: 0.5rem;
    }

    .turnos-planilla-table th,
    .turnos-planilla-table td {
        font-size: 0.82rem;
        padding: 0.28rem 0.35rem;
    }
}
