/* =====================================================================
   NETWILONE - ENTRAR Y CREAR CUENTA

   Solo la cargan /login y /registro (layouts/auth.php), despues de app.css,
   ui.css y platform.css. Clases con `ax-` para no cruzarse con las `au-`
   que siguen usando la cuenta y crear tienda.

   Pantalla dividida:
     · izquierda, el formulario sin tarjeta: arriba la marca, abajo la
       vuelta al inicio. Una columna de 400px centrada en su mitad.
     · derecha, un panel con las ventas del dia y los pedidos entregandose.
   En el telefono el panel se va y quedan el formulario y tres garantias.
   ===================================================================== */

/* El aviso de "entorno de pruebas" va en el flujo: la pantalla mide lo que
   queda debajo de el, no 100dvh mas el aviso. */
body:has(> .ax) {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}
body:has(> .ax) > .ax { flex: 1; min-height: 0; }
body:has(> .ax)::before,
body:has(> .ax)::after { display: none; }

.ax {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    min-height: 100dvh;
    background: var(--bg);
}

/* ============================================================ El formulario */

.ax-main {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 0 clamp(20px, 4vw, 56px);
}
/* Un brillo muy tenue arriba: la columna no queda plana. */
.ax-main::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 380px;
    background: radial-gradient(60% 100% at 30% 0%, rgba(0, 230, 118, .07), transparent 70%);
    pointer-events: none;
}
.ax-main > * { position: relative; }

.ax-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 76px;
}
.ax-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text);
    font-family: var(--font-display);
    font-size: 1.08rem;
    letter-spacing: -.03em;
    text-decoration: none;
}
.ax-brand:hover { color: var(--text); }
.ax-brand em { font-style: normal; color: var(--primary); }
.ax-mark { display: grid; place-items: center; width: 32px; height: 32px; }
.ax-mark img { width: 32px; height: 32px; }

.ax-top-alt { color: var(--muted); font-size: .88rem; }
.ax-top-alt a {
    margin-left: 4px;
    padding: 7px 14px;
    border: 1px solid var(--border-2);
    border-radius: var(--r-pill);
    color: var(--text);
    font-weight: 600;
    text-decoration: none;
    transition: border-color var(--fast), background var(--fast);
}
.ax-top-alt a:hover { border-color: rgba(0, 230, 118, .45); background: rgba(0, 230, 118, .06); color: var(--text); }

.ax-body {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-block: clamp(24px, 5vh, 56px);
}
.ax-form {
    width: 100%;
    max-width: 400px;
    animation: ax-in .5s var(--ease-out) both;
}
.ax-form.is-ancho { max-width: 480px; }
.ax-flashes { margin-bottom: 18px; }

.ax-head { margin-bottom: 28px; }
.ax-head h1 {
    margin: 0 0 8px;
    font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
    line-height: 1.1;
    letter-spacing: -.04em;
}
.ax-head p { margin: 0; color: var(--text-2); font-size: .97rem; line-height: 1.55; }

/* ---- Pasos del registro */
.ax-steps {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 26px;
    padding: 0;
    list-style: none;
    color: var(--muted);
    font-size: .8rem;
    font-weight: 500;
}
.ax-steps li { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.ax-steps li + li::before { content: ''; width: 24px; height: 1px; background: var(--border-2); }
.ax-steps span {
    display: grid; place-items: center;
    width: 22px; height: 22px;
    border-radius: 50%;
    border: 1px solid var(--border-2);
    font-size: .7rem;
    font-weight: 700;
}
.ax-steps .is-on { color: var(--text); }
.ax-steps .is-on span { background: var(--primary); border-color: var(--primary); color: var(--on-primary); box-shadow: 0 0 0 4px rgba(0, 230, 118, .14); }

/* ---- Campos */
.ax-fields { display: grid; gap: 18px; }
.ax-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ax-field { display: grid; gap: 7px; min-width: 0; }
.ax-field > label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text);
    font-size: .86rem;
    font-weight: 600;
}
.ax-opt {
    padding: 1px 7px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border);
    color: var(--muted);
    font-size: .64rem;
    font-weight: 500;
    letter-spacing: .05em;
    text-transform: uppercase;
}
.ax-hint { color: var(--muted); font-size: .78rem; line-height: 1.45; }
.ax-hint:empty { display: none; }
.ax-hint.es-bien { color: var(--primary); }
.ax-hint.es-mal { color: var(--danger); }

.ax-input { position: relative; }
/* La especificidad le gana a la regla de inputs de ui.css. */
.app-shell .ax .ax-input > input:not([type="checkbox"]):not([type="radio"]) {
    box-sizing: border-box;
    width: 100%;
    min-height: 50px;
    margin: 0;
    padding: 12px 14px 12px 44px;
    border: 1px solid var(--border-2);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 1rem; /* 16px: iOS no hace zoom al enfocar */
    transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
.app-shell .ax .ax-input > input:not([type="checkbox"]):not([type="radio"])::placeholder { color: var(--faint); }
.app-shell .ax .ax-input > input:not([type="checkbox"]):not([type="radio"]):hover { border-color: #2F4A39; }
.app-shell .ax .ax-input > input:not([type="checkbox"]):not([type="radio"]):focus,
.app-shell .ax .ax-input > input:not([type="checkbox"]):not([type="radio"]):focus-visible {
    outline: none;
    border-color: var(--primary);
    background: var(--surface-2);
    box-shadow: 0 0 0 4px rgba(0, 230, 118, .13);
}
.app-shell .ax .ax-input.has-eye > input:not([type="checkbox"]):not([type="radio"]) { padding-right: 52px; }

.ax-i {
    position: absolute;
    left: 15px;
    top: 50%;
    width: 18px; height: 18px;
    transform: translateY(-50%);
    background: var(--muted);
    pointer-events: none;
    -webkit-mask: var(--i) center / contain no-repeat;
    mask: var(--i) center / contain no-repeat;
    transition: background .15s ease;
}
.ax-input:focus-within .ax-i { background: var(--primary); }

.ax-i-mail  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='M3 7l9 6 9-6'/%3E%3C/svg%3E"); }
.ax-i-lock  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='11' width='16' height='10' rx='2'/%3E%3Cpath d='M8 11V7a4 4 0 0 1 8 0v4'/%3E%3C/svg%3E"); }
.ax-i-user  { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E"); }
.ax-i-phone { --i: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='6' y='2' width='12' height='20' rx='2.5'/%3E%3Cpath d='M11 18h2'/%3E%3C/svg%3E"); }

/* El ojo: un icono, no una palabra. Tachado cuando la clave esta a la vista. */
.ax-eye {
    position: absolute;
    right: 6px;
    top: 50%;
    width: 40px; height: 38px;
    transform: translateY(-50%);
    border: 0;
    border-radius: 9px;
    background: transparent;
    cursor: pointer;
}
.ax-eye::before {
    content: '';
    position: absolute;
    inset: 0;
    margin: auto;
    width: 19px; height: 19px;
    background: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%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 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ax-eye.is-on::before {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M3 3l18 18'/%3E%3C/svg%3E");
    background: var(--primary);
}
.ax-eye:hover { background: rgba(255, 255, 255, .04); }
.ax-eye:hover::before { background: var(--text); }
.ax-eye:focus-visible { outline: 2px solid var(--primary); outline-offset: 0; }

/* ---- Fuerza de la contrasena: cuatro segmentos */
.ax-strength { display: grid; gap: 6px; margin-top: -6px; }
.ax-strength-bar { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.ax-strength-bar i { height: 4px; border-radius: 4px; background: var(--surface-3); transition: background .2s ease; }
.ax-strength[data-n="1"] .ax-strength-bar i:nth-child(-n + 1),
.ax-strength[data-n="2"] .ax-strength-bar i:nth-child(-n + 2),
.ax-strength[data-n="3"] .ax-strength-bar i:nth-child(-n + 3),
.ax-strength[data-n="4"] .ax-strength-bar i { background: var(--seg, var(--muted)); }
.ax-strength.es-mal   { --seg: #FF6B6B; }
.ax-strength.es-medio { --seg: #E5A13B; }
.ax-strength.es-bien  { --seg: var(--primary); }
.ax-strength.es-mal   #fuerzaTxt { color: #FF6B6B; }
.ax-strength.es-medio #fuerzaTxt { color: #E5A13B; }
.ax-strength.es-bien  #fuerzaTxt { color: var(--primary); }

/* ---- Botones */
.ax .ax-submit,
.ax .ax-second {
    width: 100%;
    min-height: 52px;
    justify-content: center;
    border-radius: 12px;
    font-size: 1rem;
}
.ax .ax-submit { margin-top: 6px; box-shadow: 0 10px 30px -10px rgba(0, 230, 118, .55); }

.ax-sep {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 26px 0 16px;
    color: var(--muted);
    font-size: .82rem;
}
.ax-sep::before, .ax-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.ax-legal { margin: 2px 0 0; color: var(--faint); font-size: .76rem; line-height: 1.55; text-align: center; }

/* Las garantias del telefono: en escritorio las dice el panel. */
.ax-mtrust { display: none; }

/* ---- Pie */
.ax-foot {
    display: flex;
    align-items: center;
    gap: 10px 22px;
    flex-wrap: wrap;
    min-height: 68px;
    color: var(--muted);
    font-size: .8rem;
}
.ax-foot svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ax-volver, .ax-seguro { display: inline-flex; align-items: center; gap: 7px; }
.ax-volver { color: var(--text-2); text-decoration: none; }
.ax-volver:hover { color: var(--primary); }
.ax-seguro svg { stroke: var(--primary); }
.ax-copy { margin-left: auto; }

/* ============================================================== El panel */

.ax-side {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 12px 12px 12px 0;
    padding: clamp(36px, 5vw, 72px);
    border: 1px solid var(--border);
    border-radius: 28px;
    background:
        radial-gradient(90% 60% at 100% 0%, rgba(0, 230, 118, .2), transparent 60%),
        radial-gradient(70% 50% at 0% 100%, rgba(0, 230, 118, .08), transparent 60%),
        linear-gradient(180deg, #0B1510, #070B09);
    overflow: hidden;
}
/* Rejilla tenue: fondo sin pedir atencion. */
.ax-side::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, .04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .04) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: radial-gradient(70% 60% at 60% 40%, #000, transparent);
    mask-image: radial-gradient(70% 60% at 60% 40%, #000, transparent);
    pointer-events: none;
}
.ax-side-in {
    position: relative;
    width: 100%;
    max-width: 480px;
    animation: ax-in .6s var(--ease-out) .1s both;
}

.ax-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 5px 13px 5px 10px;
    border-radius: var(--r-pill);
    border: 1px solid rgba(0, 230, 118, .3);
    background: rgba(0, 230, 118, .08);
    color: var(--primary);
    font-size: .78rem;
    font-weight: 600;
}
.ax-eyebrow i { width: 7px; height: 7px; border-radius: 50%; background: var(--primary); box-shadow: 0 0 0 3px rgba(0, 230, 118, .2); }

.ax-claim {
    margin: 18px 0 32px;
    font-size: clamp(1.8rem, 1.1rem + 1.6vw, 2.6rem);
    line-height: 1.08;
    letter-spacing: -.04em;
}
.ax-claim span {
    background: linear-gradient(100deg, var(--primary-3), var(--primary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---- El tablero */
.ax-stage { position: relative; padding-bottom: 42px; }

.ax-dash {
    border: 1px solid var(--border-2);
    border-radius: 18px;
    background: rgba(9, 14, 11, .85);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 40px 90px -30px rgba(0, 0, 0, .8), inset 0 1px 0 rgba(255, 255, 255, .04);
    overflow: hidden;
}
.ax-dash-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0;
}
.ax-dash-head small { display: block; color: var(--muted); font-size: .76rem; }
.ax-dash-head b { display: block; margin-top: 2px; font-family: var(--font-display); font-size: 1.6rem; letter-spacing: -.035em; }
.ax-dash-head em { font-style: normal; font-family: var(--font); font-size: .74rem; font-weight: 700; color: var(--primary); margin-left: 6px; vertical-align: 4px; }
.ax-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: .7rem;
    font-weight: 600;
}
.ax-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); animation: ax-pulse 1.8s ease-in-out infinite; }

.ax-chart { display: block; width: 100%; height: 74px; margin-top: 10px; }
.ax-chart-area { fill: url(#axg); }
.ax-chart-line {
    fill: none;
    stroke: var(--primary);
    stroke-width: 2.2;
    stroke-linecap: round;
    vector-effect: non-scaling-stroke;
    stroke-dasharray: 1400;
    stroke-dashoffset: 1400;
    animation: ax-draw 1.8s var(--ease-out) .4s forwards;
}

.ax-orders { margin: 0; padding: 6px 10px 10px; list-style: none; border-top: 1px solid var(--border); }
.ax-orders li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 11px;
}
.ax-orders li + li { border-top: 1px solid rgba(26, 42, 32, .6); }
.ax-o-ico {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 9px;
    background: var(--c);
    color: #fff;
    font-family: var(--font-display);
    font-weight: 800;
}
.ax-o-t b { display: block; font-size: .86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ax-o-t small { display: block; color: var(--muted); font-size: .72rem; }
.ax-o-p { font-family: var(--mono); font-size: .82rem; font-weight: 600; }
.ax-o-ok {
    padding: 3px 9px;
    border-radius: var(--r-pill);
    background: rgba(0, 230, 118, .1);
    border: 1px solid rgba(0, 230, 118, .25);
    color: var(--primary);
    font-size: .68rem;
    font-weight: 700;
}

.ax-toast {
    position: absolute;
    left: -22px;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 16px 11px 11px;
    border: 1px solid rgba(0, 230, 118, .3);
    border-radius: 14px;
    background: rgba(14, 24, 18, .92);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    box-shadow: 0 24px 50px -14px rgba(0, 0, 0, .8);
    animation: ax-float 6s ease-in-out infinite;
}
.ax-toast > span {
    display: grid; place-items: center;
    width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--primary);
}
.ax-toast svg { width: 17px; height: 17px; fill: none; stroke: var(--on-primary); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ax-toast b { display: block; font-size: .82rem; }
.ax-toast small { display: block; color: var(--muted); font-size: .72rem; }

.ax-points,
.ax-mtrust {
    margin: 0;
    padding: 0;
    list-style: none;
}
.ax-points { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 30px; color: var(--text-2); font-size: .86rem; }
.ax-points li,
.ax-mtrust li { display: inline-flex; align-items: center; gap: 8px; }
.ax-points svg,
.ax-mtrust svg { width: 16px; height: 16px; flex: none; fill: none; stroke: var(--primary); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ============================================================ Animaciones */

@keyframes ax-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes ax-float { 50% { transform: translateY(-7px); } }
@keyframes ax-pulse { 50% { opacity: .35; } }
@keyframes ax-draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
    .ax-form, .ax-side-in, .ax-toast, .ax-live i { animation: none; }
    .ax-chart-line { animation: none; stroke-dashoffset: 0; }
}

/* ============================================================== Pantallas */

@media (max-width: 1180px) {
    .ax { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
    .ax-o-ok { display: none; }
    .ax-orders li { grid-template-columns: auto minmax(0, 1fr) auto; }
}

@media (max-width: 960px) {
    .ax { grid-template-columns: minmax(0, 1fr); }
    .ax-side { display: none; }
    .ax-body { align-items: flex-start; }
    .ax-form, .ax-form.is-ancho { max-width: 460px; }

    .ax-mtrust {
        display: grid;
        gap: 10px;
        margin-top: 28px;
        padding: 16px 18px;
        border: 1px solid var(--border);
        border-radius: 14px;
        background: rgba(255, 255, 255, .02);
        color: var(--text-2);
        font-size: .86rem;
    }
}

@media (max-width: 560px) {
    .ax-main { padding-inline: 20px; }
    .ax-top { min-height: 64px; }
    .ax-hide-xs { display: none; }
    .ax-body { padding-block: 12px 28px; }
    .ax-head { margin-bottom: 22px; }
    .ax-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
    .ax-steps { font-size: .76rem; gap: 6px; }
    .ax-steps li + li::before { width: 14px; }
    .ax-foot { justify-content: center; text-align: center; padding-bottom: 8px; }
    .ax-copy { margin-left: 0; width: 100%; }
}
