/* =========================================================================
   Login KDS
   Formulario a la izquierda sobre blanco; a la derecha, un panel que explica
   el flujo del KDS (de dónde llegan las órdenes y qué pasa al marcarlas como
   listas). Se carga después de lock.min.css de Metronic: los selectores
   llevan "html body" para ganarle en especificidad.
   ========================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@500;600;700;800&display=swap');

:root {
    --font: 'Manrope', 'Helvetica Neue', Arial, sans-serif;
    /* Marca Drizline (mismo azul que la barra del turnero Drizline) */
    --brand: #2b388f;
    --brand-600: #232e78;
    --brand-ring: rgba(43, 56, 143, 0.16);
    --danger: #c62828;
    --paper: #f7f8fb;
    --dots: #d5d9e6;
    --ink: #151a33;
    --ink-2: #3d4360;
    --muted: #646a85;
    --line: #dfe2ec;
    --line-strong: #c3c8db;
    --ok: #1e9e57;
    /* Colores de las plataformas, iguales a los del turnero */
    --rappi: #d9300e;
    --uber: #000000;
    --uber-green: #06c167;
    --didi: #c75000;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
html body {
    min-height: 100%;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

html body.login-kds {
    margin: 0;
    background: #fff !important; /* lock.min.css: body { background-color: #f2f2f2 !important } */
    color: var(--ink);
}

html body input,
html body button {
    font-family: var(--font);
}

::selection {
    background: var(--brand-ring);
}

/* -------------------------------------------------------------------------
   Estructura: dos columnas a toda la pantalla
   ------------------------------------------------------------------------- */
html body .page-lock {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    box-sizing: border-box;
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 16px;
}

/* -------------------------------------------------------------------------
   Columna del formulario
   ------------------------------------------------------------------------- */
html body .page-lock .page-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: auto;
    margin: 0;
    padding: 40px 24px 8px;
    background: transparent;
    border-radius: 0;
}

html body .page-lock .login-panel {
    width: min(380px, 100%);
    margin: auto 0;
}

html body .page-lock .page-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 0 0 36px;
}

/* El logo es blanco (PNG): se pinta en azul de marca usando la imagen como máscara */
html body .page-lock .page-logo .brand {
    display: block;
    width: 128px;
    height: 39px;
    background: var(--brand);
    -webkit-mask: url("/images/log_drizline.png") center / contain no-repeat;
    mask: url("/images/log_drizline.png") center / contain no-repeat;
}

html body .page-lock .page-logo .brand img {
    display: block;
    width: 100%;
    height: 100%;
    opacity: 0;
}

html body .page-lock .brand-product {
    padding-left: 12px;
    border-left: 1px solid var(--line);
    color: var(--brand);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 24px;
}

html body .page-lock .lock-head {
    display: block;
    margin: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    color: var(--ink);
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    text-align: center;
}

html body .page-lock .lock-subhead {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.5;
    text-align: center;
}

html body .page-lock .lock-body {
    margin: 32px 0 0;
    overflow: visible;
}

html body .page-lock .lock-form {
    float: none;
    width: 100%;
    padding: 0;
}

html body .page-lock .lock-form .form-group {
    margin: 0 0 18px;
}

html body .page-lock .lock-form .form-group .control-label {
    display: block;
    margin: 0 0 7px;
    color: var(--ink-2);
    font-size: 14px;
    font-weight: 700;
}

html body .page-lock .lock-form .form-group .form-control {
    box-sizing: border-box;
    width: 100%;
    height: 48px;
    padding: 0 14px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-size: 15px;
    font-weight: 600;
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.04);
    caret-color: var(--brand);
    transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

html body .page-lock .lock-form .form-group .form-control::placeholder {
    color: #8a8fa6;
    font-weight: 500;
    opacity: 1;
}

html body .page-lock .lock-form .form-group .form-control:hover {
    border-color: var(--line-strong);
}

html body .page-lock .lock-form .form-group .form-control:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 4px var(--brand-ring);
}

/* Contraseña con botón para mostrar/ocultar */
html body .page-lock .input-with-action {
    position: relative;
}

html body .page-lock .input-with-action .form-control {
    padding-right: 50px;
}

html body .page-lock .toggle-password {
    position: absolute;
    top: 50%;
    right: 4px;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

html body .page-lock .toggle-password::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: 20px;
    height: 20px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.8 10s3-5.8 8.2-5.8 8.2 5.8 8.2 5.8-3 5.8-8.2 5.8S1.8 10 1.8 10z'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1.8 10s3-5.8 8.2-5.8 8.2 5.8 8.2 5.8-3 5.8-8.2 5.8S1.8 10 1.8 10z'/%3E%3Ccircle cx='10' cy='10' r='2.6'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .page-lock .toggle-password[aria-pressed="true"]::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.2 4.4A8.6 8.6 0 0 1 10 4.2c5.2 0 8.2 5.8 8.2 5.8a14 14 0 0 1-2.3 3.1M5.3 5.6C3 7.1 1.8 10 1.8 10s3 5.8 8.2 5.8a8 8 0 0 0 4.1-1.1'/%3E%3Cpath d='M8.2 8.2a2.6 2.6 0 0 0 3.6 3.6'/%3E%3Cpath d='M2.5 2.5l15 15'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8.2 4.4A8.6 8.6 0 0 1 10 4.2c5.2 0 8.2 5.8 8.2 5.8a14 14 0 0 1-2.3 3.1M5.3 5.6C3 7.1 1.8 10 1.8 10s3 5.8 8.2 5.8a8 8 0 0 0 4.1-1.1'/%3E%3Cpath d='M8.2 8.2a2.6 2.6 0 0 0 3.6 3.6'/%3E%3Cpath d='M2.5 2.5l15 15'/%3E%3C/svg%3E");
}

html body .page-lock .toggle-password:hover {
    background: rgba(43, 56, 143, 0.08);
    color: var(--brand);
}

html body .page-lock .toggle-password:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 0;
}

/* Error en línea, arriba del botón */
html body .page-lock .error_msg #login-error {
    margin: 0;
    color: var(--danger);
    font-size: 14px;
    font-weight: 600;
    line-height: 20px;
}

html body .page-lock .error_msg #login-error:not(:empty) {
    display: flex;
    gap: 8px;
    margin: -4px 0 16px;
}

html body .page-lock .error_msg #login-error:not(:empty)::before {
    content: "";
    flex: 0 0 18px;
    height: 18px;
    margin-top: 1px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' d='M10 1.5a8.5 8.5 0 1 1 0 17 8.5 8.5 0 0 1 0-17zm0 11.6a1.15 1.15 0 1 0 0 2.3 1.15 1.15 0 0 0 0-2.3zM10 5a1.1 1.1 0 0 0-1.1 1.15l.25 5a.85.85 0 0 0 1.7 0l.25-5A1.1 1.1 0 0 0 10 5z'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill='black' d='M10 1.5a8.5 8.5 0 1 1 0 17 8.5 8.5 0 0 1 0-17zm0 11.6a1.15 1.15 0 1 0 0 2.3 1.15 1.15 0 0 0 0-2.3zM10 5a1.1 1.1 0 0 0-1.1 1.15l.25 5a.85.85 0 0 0 1.7 0l.25-5A1.1 1.1 0 0 0 10 5z'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .page-lock .lock-form .form-actions {
    margin: 6px 0 0;
}

html body .page-lock #login-button {
    width: 100%;
    height: 48px;
    margin: 0;
    padding: 0;
    background: var(--brand);
    border: 0;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.01em;
    text-transform: none !important; /* Metronic: .uppercase { text-transform: uppercase !important } */
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.1), 0 10px 22px -12px rgba(43, 56, 143, 0.8);
    transition: background-color 0.18s var(--ease), transform 0.12s var(--ease), box-shadow 0.18s var(--ease);
}

html body .page-lock #login-button:hover,
html body .page-lock #login-button:focus {
    background: var(--brand-600);
    color: #fff;
}

html body .page-lock #login-button:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--brand);
}

html body .page-lock #login-button:active {
    transform: scale(0.985);
    box-shadow: none;
}

/* Estado de carga: botón deshabilitado con indicador giratorio */
html body .page-lock #login-button[disabled] {
    opacity: 1;
    cursor: progress;
    background: var(--brand-600);
    box-shadow: none;
}

html body .page-lock #login-button[aria-busy="true"]::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: -3px 10px 0 0;
    vertical-align: middle;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
}

@keyframes login-spin {
    to { transform: rotate(360deg); }
}

html body .page-footer-custom {
    padding: 24px 0 8px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

/* -------------------------------------------------------------------------
   Panel del flujo del KDS
   ------------------------------------------------------------------------- */
html body .login-flow {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 44px;
    padding: 48px 32px;
    overflow: hidden;
    background:
        radial-gradient(circle, var(--dots) 1px, transparent 1.4px) 0 0 / 16px 16px,
        var(--paper);
    border: 1px solid #eceef4;
    border-radius: 20px;
}

html body .login-flow-head {
    max-width: 460px;
    text-align: center;
}

html body .login-flow-head h2 {
    margin: 0;
    color: var(--ink);
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.025em;
    line-height: 1.2;
    text-wrap: balance;
}

html body .login-flow-head p {
    margin: 10px 0 0;
    color: var(--muted);
    font-size: 15px;
    font-weight: 500;
    line-height: 1.55;
    text-wrap: balance;
}

/* Diagrama: lienzo fijo de 460 x 400; las coordenadas del SVG y de los
   elementos posicionados coinciden */
html body .flow {
    position: relative;
    flex: 0 0 auto;
    width: 460px;
    height: 400px;
}

html body .flow-lines {
    position: absolute;
    inset: 0;
    overflow: visible;
}

html body .flow-lines path {
    fill: none;
    stroke: var(--line-strong);
    stroke-width: 1.5;
    stroke-dasharray: 1 6;
    stroke-linecap: round;
}

/* Canales de origen */
html body .flow-chip {
    position: absolute;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 84px;
    height: 34px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 9px;
    color: var(--ink);
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: -0.01em;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.05), 0 6px 14px -8px rgba(21, 26, 51, 0.25);
}

html body .flow .origin-rappi    { background: var(--rappi); border-color: var(--rappi); color: #fff; }
html body .flow .origin-ubereats { background: var(--uber); border-color: var(--uber); color: var(--uber-green); }
html body .flow .origin-didi     { background: var(--didi); border-color: var(--didi); color: #fff; }

/* Etiquetas sobre las líneas */
html body .flow-step {
    position: absolute;
    left: 50%;
    z-index: 2;
    display: flex;
    align-items: center;
    height: 28px;
    padding: 0 12px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink-2);
    font-size: 12.5px;
    font-weight: 700;
    white-space: nowrap;
    transform: translateX(-50%);
}

/* Orden en el turnero, con dos más asomándose detrás */
html body .flow-tickets {
    position: absolute;
    top: 160px;
    left: 30px;
    width: 400px;
    height: 84px;
}

html body .flow-ticket {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    height: 62px;
    padding: 0 12px;
    border-radius: 12px;
    color: var(--ink);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.06), 0 16px 30px -18px rgba(21, 26, 51, 0.45);
}

html body .flow-ticket.is-ghost {
    background: #fff;
    border: 1px solid var(--line);
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.04);
}

html body .flow-ticket.is-ghost-1 { top: 11px; left: 14px; right: 14px; opacity: 0.85; }
html body .flow-ticket.is-ghost-2 { top: 22px; left: 28px; right: 28px; opacity: 0.6; }

html body .flow-ticket.is-warn {
    z-index: 1;
    background: #fdf5da;
    border: 1px solid #f3e3a6;
}

html body .flow-ticket b {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.02em;
}

html body .flow-ticket-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 34px;
    padding: 0 12px 0 10px;
    border-radius: 9px;
    background: var(--ink);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
}

html body .flow-ticket-btn::before,
html body .flow-result::before {
    content: "";
    width: 14px;
    height: 14px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8.5l3.2 3.2L13 4.8'/%3E%3C/svg%3E") center / contain no-repeat;
}

html body .flow-badge {
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11.5px;
    font-weight: 800;
}

html body .flow-ticket-hour {
    margin-left: auto;
    color: var(--ink-2);
    font-variant-numeric: tabular-nums;
}

html body .flow-ticket-time {
    padding: 5px 11px;
    border-radius: 999px;
    background: #f2b200;
    color: var(--ink);
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* Resultado de marcar la orden como lista */
html body .flow-result {
    position: absolute;
    top: 360px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 180px;
    height: 36px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(21, 26, 51, 0.05), 0 6px 14px -8px rgba(21, 26, 51, 0.25);
}

html body .flow-result::before {
    color: var(--ok);
}

/* Recorrido animado: una orden de Rappi llega, se marca lista y se avisa.
   Un solo ciclo de 7 s para todo el diagrama. */
html body .flow-dot {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--rappi);
    box-shadow: 0 0 0 4px rgba(217, 48, 14, 0.18);
    offset-anchor: center;
    offset-rotate: 0deg;
    opacity: 0;
    animation: 7s var(--ease) infinite;
}

html body .flow-dot-in {
    offset-path: path("M230 34 L230 160");
    animation-name: flow-dot-in;
}

html body .flow-dot-out {
    offset-path: path("M230 244 L230 308 C230 336 340 330 340 360");
    animation-name: flow-dot-out;
}

html body .flow-ticket.is-warn .flow-ticket-btn {
    animation: flow-press 7s var(--ease) infinite;
}

html body .flow-result {
    animation: flow-done 7s var(--ease) infinite;
}

@keyframes flow-dot-in {
    0%   { offset-distance: 0%; opacity: 0; }
    4%   { opacity: 1; }
    24%  { offset-distance: 100%; opacity: 1; }
    28%, 100% { offset-distance: 100%; opacity: 0; }
}

@keyframes flow-press {
    0%, 38%  { transform: none; box-shadow: none; }
    42%      { transform: scale(0.92); box-shadow: 0 0 0 5px rgba(21, 26, 51, 0.14); }
    48%, 100% { transform: none; box-shadow: none; }
}

@keyframes flow-dot-out {
    0%, 46% { offset-distance: 0%; opacity: 0; }
    49%     { offset-distance: 0%; opacity: 1; }
    72%     { offset-distance: 100%; opacity: 1; }
    76%, 100% { offset-distance: 100%; opacity: 0; }
}

@keyframes flow-done {
    0%, 70%  { border-color: var(--line); box-shadow: 0 1px 2px rgba(21, 26, 51, 0.05), 0 6px 14px -8px rgba(21, 26, 51, 0.25); }
    76%, 90% { border-color: var(--ok); box-shadow: 0 0 0 4px rgba(30, 158, 87, 0.14), 0 6px 14px -8px rgba(21, 26, 51, 0.25); }
    100%     { border-color: var(--line); box-shadow: 0 1px 2px rgba(21, 26, 51, 0.05), 0 6px 14px -8px rgba(21, 26, 51, 0.25); }
}

/* Panel angosto o pantalla baja: el diagrama se reduce */
@media (max-width: 1100px), (max-height: 720px) {
    html body .flow {
        zoom: 0.84;
    }

    html body .login-flow {
        gap: 32px;
    }
}

/* Tablet vertical o celular: solo el formulario */
@media (max-width: 900px) {
    html body .page-lock {
        grid-template-columns: minmax(0, 1fr);
    }

    html body .login-flow {
        display: none;
    }

    html body .page-lock .page-body {
        padding-top: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html body .flow-dot {
        display: none;
    }

    *,
    *::before,
    *::after {
        transition: none !important;
        animation: none !important;
    }

    html body .page-lock #login-button[aria-busy="true"]::before {
        animation: login-spin 2s linear infinite !important;
    }
}
