/* =========================================================
   Barbaros — "Voix" auth layout (login.html / signup.html)
   Dark split screen: editorial testimonial carousel + form card.
   Class names used by the page scripts are kept on purpose:
   .field / .is-invalid / .field-msg span, .btn.is-loading,
   .sheet / .is-open / .is-done, .toast / .t-* — do not rename.
   ========================================================= */
:root {
    --vx-page: #1F1E22;
    --vx-s2: #29272D;
    --vx-field: #1F1E22;
    --vx-ink: #F6F5F8;
    --vx-ink2: #CEC9D5;
    --vx-ink3: #A39DAD;
    --vx-line: rgba(255, 255, 255, .12);
    --vx-field-line: rgba(255, 255, 255, .14);
    --vx-accent: #4C9DFF;
    --vx-accent-soft: rgba(76, 157, 255, .30);
    --vx-btn: #F6F5F8;
    --vx-btn-ink: #1F1E22;
    --vx-success: #3DD598;
    --vx-danger: #FF6B7A;
    --vx-warn: #F5B544;
    --vx-r: 10px;
    --vx-serif: "Newsreader", Georgia, "Times New Roman", serif;
    --vx-sans: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
    --vx-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
    color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body.vx-body {
    min-height: 100vh; min-height: 100svh;
    background: var(--vx-page);
    color: var(--vx-ink);
    font-family: var(--vx-sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}
button, input { font: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--vx-accent); outline-offset: 2px; }
.vx-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.vx-skip { position: absolute; left: 12px; top: -60px; z-index: 300; padding: 10px 14px; border-radius: 8px; background: var(--vx-btn); color: var(--vx-btn-ink); font-size: 14px; font-weight: 600; text-decoration: none; }
.vx-skip:focus { top: 12px; }

/* ---------- Shell ---------- */
.vx-shell {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    min-height: 100vh; min-height: 100svh;
}

/* ---------- Voices (left) ---------- */
.vx-voices {
    position: relative;
    padding: 40px clamp(24px, 5vw, 80px) 40px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
    overflow: hidden; isolation: isolate;
}
.vx-voices::before {
    content: ""; position: absolute; z-index: -1; right: 0; top: 12%; width: 75%; height: 70%;
    background: radial-gradient(closest-side, rgba(76, 157, 255, .12), transparent);
    pointer-events: none;
}
.vx-brand { display: inline-flex; align-items: center; border-radius: 8px; }
.vx-brand img { display: block; height: 30px; width: auto; }
.vx-k {
    display: flex; align-items: center; justify-content: space-between; gap: 16px;
    font: 500 11px/1 var(--vx-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--vx-ink3);
    margin-bottom: 36px;
}
.vx-k b { font-weight: 500; color: var(--vx-ink2); }
.vx-slides { position: relative; display: grid; min-height: 340px; }
.vx-slide {
    grid-area: 1 / 1; margin: 0;
    display: flex; flex-direction: column; justify-content: center;
    opacity: 0; transform: translateY(14px); visibility: hidden;
    transition: opacity .7s, transform .7s cubic-bezier(.2, .7, .2, 1), visibility 0s .7s;
}
.vx-slide.on { opacity: 1; transform: none; visibility: visible; transition: opacity .7s, transform .7s cubic-bezier(.2, .7, .2, 1), visibility 0s; }
.vx-q {
    margin: 0 0 30px;
    font: 400 clamp(26px, 2.9vw, 42px)/1.22 var(--vx-serif);
    letter-spacing: -.015em; color: var(--vx-ink); max-width: 720px; text-wrap: pretty;
}
.vx-q::before { content: "\201C"; display: block; font-size: 72px; line-height: .6; color: var(--vx-accent); margin-bottom: 8px; }
.vx-who { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.vx-av { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 600; font-size: 15px; color: #fff; flex: none; }
.vx-who strong { display: block; font-size: 15px; font-weight: 600; }
.vx-who .vx-shop { display: block; font-size: 13px; color: var(--vx-ink3); margin-top: 2px; }
.vx-metric {
    margin-left: auto; display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 99px;
    background: rgba(61, 213, 152, .12); color: var(--vx-success); font-size: 13px; font-weight: 600;
    border: 1px solid rgba(61, 213, 152, .25); white-space: nowrap;
}
.vx-metric svg { width: 14px; height: 14px; }
.vx-ctrl { display: flex; align-items: center; gap: 12px; }
.vx-segs { display: flex; gap: 6px; flex: 1; max-width: 260px; }
.vx-seg { flex: 1; height: 24px; border: 0; background: transparent; padding: 10px 0; cursor: pointer; border-radius: 4px; }
.vx-seg i { display: block; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .16); overflow: hidden; }
.vx-seg i::after { content: ""; display: block; height: 100%; width: 0; background: var(--vx-ink); }
.vx-seg.done i::after { width: 100%; }
.vx-seg.on i::after { animation: vxfill var(--vx-dur, 6.5s) linear forwards; }
.vx-voices.paused .vx-seg.on i::after { animation-play-state: paused; }
@keyframes vxfill { to { width: 100%; } }
.vx-btn {
    width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--vx-line); background: transparent;
    color: var(--vx-ink); display: grid; place-items: center; cursor: pointer; flex: none;
    transition: background .15s;
}
.vx-btn:hover { background: rgba(255, 255, 255, .06); }
.vx-btn svg { width: 16px; height: 16px; }
.vx-note { margin: 12px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--vx-ink3); }

/* ---------- Form side (right) ---------- */
.vx-formside {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
    padding: 32px;
}
.vx-card {
    width: 100%; max-width: 440px;
    background: var(--vx-s2); border: 1px solid var(--vx-line); border-radius: 22px; padding: 38px;
}
.vx-card-brand { display: none; }
.vx-title {
    margin: 0 0 8px; font: 400 32px/1.12 var(--vx-serif); letter-spacing: -.015em; color: var(--vx-ink);
}
.vx-sub { margin: 0 0 26px; font-size: 14.5px; line-height: 1.55; color: var(--vx-ink2); }
.vx-sub [lang="ar"] { display: block; margin-top: 4px; font-size: 13px; color: var(--vx-ink3); }

/* social buttons */
.vx-social { display: grid; gap: 10px; }
.vx-social-row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.btn-social {
    position: relative; width: 100%; height: 46px; display: flex; align-items: center; justify-content: center; gap: 10px;
    border-radius: var(--vx-r); border: 1px solid var(--vx-field-line); background: var(--vx-field); color: var(--vx-ink);
    font-size: 14.5px; font-weight: 500; cursor: pointer; transition: border-color .15s, background .15s, transform .1s;
}
.btn-social:hover { border-color: var(--vx-ink3); }
.btn-social:active { transform: scale(.99); }
.btn-social svg { width: 18px; height: 18px; flex: none; }
.btn-social.is-quiet { height: 40px; font-size: 13.5px; color: var(--vx-ink2); background: transparent; }
.btn-social.is-loading svg { display: none; }

.vx-or {
    display: flex; align-items: center; gap: 12px; margin: 20px 0; color: var(--vx-ink3);
    font-size: 11.5px; text-transform: uppercase; letter-spacing: .14em;
}
.vx-or::before, .vx-or::after { content: ""; flex: 1; height: 1px; background: var(--vx-line); }

/* fields */
.form { margin: 0; }
.vx-formerr {
    display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: var(--vx-r);
    background: color-mix(in srgb, var(--vx-danger) 11%, transparent);
    border: 1px solid color-mix(in srgb, var(--vx-danger) 38%, transparent);
    color: var(--vx-ink); font-size: 13.5px; margin: 0 0 16px; line-height: 1.45;
}
.vx-formerr:empty { display: none; }
.field { margin: 0 0 16px; }
.field > label:not(.check), .vx-lrow > label { display: block; font-size: 13px; font-weight: 500; color: var(--vx-ink); margin: 0 0 7px; }
.vx-lrow { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.vx-lrow > label { margin-bottom: 7px; }
.control { position: relative; }
.control input {
    display: block; width: 100%; height: 46px; padding: 0 14px; border-radius: var(--vx-r);
    border: 1px solid var(--vx-field-line); background: var(--vx-field); color: var(--vx-ink); font-size: 15px;
    transition: border-color .15s, box-shadow .15s; -webkit-appearance: none; appearance: none;
}
.control input::placeholder { color: var(--vx-ink3); opacity: .7; }
.control input:hover { border-color: var(--vx-ink3); }
.control input:focus, .control input:focus-visible { outline: none; border-color: var(--vx-accent); box-shadow: 0 0 0 3px var(--vx-accent-soft); }
.control input.has-trail { padding-right: 50px; }
.field.is-invalid .control input { border-color: var(--vx-danger); }
.field.is-invalid .control input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--vx-danger) 26%, transparent); }
.trail {
    position: absolute; right: 5px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 8px;
    background: transparent; color: var(--vx-ink3); display: grid; place-items: center; cursor: pointer;
}
.trail:hover { color: var(--vx-ink); background: rgba(255, 255, 255, .07); }
.trail svg { width: 18px; height: 18px; }
.trail .ico-off { display: none; }
.trail[aria-pressed="true"] .ico-on { display: none; }
.trail[aria-pressed="true"] .ico-off { display: block; }
.vx-hint { display: block; font-size: 12px; color: var(--vx-ink3); margin: 7px 0 0; line-height: 1.4; }
.field.is-invalid .vx-hint { display: none; }
.field-msg {
    display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--vx-danger);
    margin: 7px 0 0; line-height: 1.4; font-weight: 500;
}
.field-msg svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }
.field-msg span:empty { display: none; }
.field:not(.is-invalid) .field-msg svg { display: none; }
.field:not(.is-invalid) .field-msg { margin: 0; }

.vx-link {
    background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--vx-accent); cursor: pointer;
    text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; transition: text-decoration-color .15s;
    border-radius: 3px;
}
.vx-link:hover { text-decoration-color: currentColor; }
.vx-forgot { font-size: 13px; font-weight: 500; }

/* strength meter (data-level 0–4, set by the page script) */
.strength { display: flex; align-items: center; gap: 10px; margin-top: 9px; }
.strength-bars { display: flex; gap: 4px; flex: 1; }
.strength-bars i { flex: 1; height: 4px; border-radius: 4px; background: var(--vx-line); transition: background .2s; }
.strength[data-level="1"] i:nth-child(-n+1) { background: var(--vx-danger); }
.strength[data-level="2"] i:nth-child(-n+2) { background: var(--vx-warn); }
.strength[data-level="3"] i:nth-child(-n+3) { background: var(--vx-accent); }
.strength[data-level="4"] i { background: var(--vx-success); }
.strength-text { display: block; font-size: 12px; color: var(--vx-ink3); margin-top: 6px; }

/* checkbox */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--vx-ink2); cursor: pointer; margin: 0 0 16px; }
.field .check { margin: 0; }
.check input {
    -webkit-appearance: none; appearance: none; flex: none; width: 18px; height: 18px; margin: 2px 0 0; border-radius: 5px;
    border: 1px solid var(--vx-field-line); background: var(--vx-field); display: grid; place-items: center; cursor: pointer;
    transition: background .15s, border-color .15s;
}
.check input::after {
    content: ""; width: 10px; height: 6px; border: 2px solid var(--vx-btn-ink); border-top: 0; border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px); opacity: 0;
}
.check input:checked { background: var(--vx-btn); border-color: var(--vx-btn); }
.check input:checked::after { opacity: 1; }
.check input:focus-visible { outline: 2px solid var(--vx-accent); outline-offset: 2px; }
.field.is-invalid .check input { border-color: var(--vx-danger); }
.check a { color: var(--vx-ink); text-underline-offset: 3px; }
.check a:hover { color: var(--vx-accent); }

/* buttons */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px; cursor: pointer; }
.btn-primary {
    width: 100%; height: 48px; margin-top: 8px; border: 0; border-radius: var(--vx-r);
    background: var(--vx-btn); color: var(--vx-btn-ink); font-size: 15px; font-weight: 600;
    transition: filter .15s, transform .1s;
}
.btn-primary:hover { filter: brightness(.94); }
.btn-primary:active { transform: scale(.99); }
.btn-ghost {
    height: 42px; padding: 0 16px; border-radius: var(--vx-r); border: 1px solid var(--vx-field-line);
    background: transparent; color: var(--vx-ink); font-size: 14px; font-weight: 500;
}
.btn-ghost:hover { background: rgba(255, 255, 255, .06); }
.sheet-actions .btn-primary { width: auto; margin: 0; height: 42px; padding: 0 18px; font-size: 14px; }
.btn[disabled] { cursor: progress; }
.btn-spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: vxspin .7s linear infinite; flex: none; }
.btn.is-loading .btn-spinner { display: block; }
.btn.is-loading .btn-label { opacity: .7; }
@keyframes vxspin { to { transform: rotate(360deg); } }

.vx-switch { margin: 22px 0 0; text-align: center; font-size: 14px; color: var(--vx-ink2); }
.vx-switch a { font-weight: 600; color: var(--vx-accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: transparent; }
.vx-switch a:hover { text-decoration-color: currentColor; }
.vx-legal { margin: 14px 0 0; text-align: center; font-size: 12px; line-height: 1.55; color: var(--vx-ink3); }
.vx-legal a { color: inherit; }
.vx-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; font-size: 12.5px; }
.vx-foot a { color: var(--vx-ink3); text-decoration: none; border-radius: 3px; }
.vx-foot a:hover { color: var(--vx-ink); }

/* ---------- Reset-password sheet ---------- */
.sheet[hidden] { display: none; }
.sheet { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; }
.sheet-scrim { position: absolute; inset: 0; background: rgba(10, 9, 12, .66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.sheet-panel {
    position: relative; width: 100%; max-width: 420px; background: var(--vx-s2); border: 1px solid var(--vx-line);
    border-radius: 20px; padding: 28px; box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
    animation: vxin .28s cubic-bezier(.2, .7, .2, 1);
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.sheet-head h2, .sheet-success h2 { margin: 0 0 6px; font: 400 24px/1.2 var(--vx-serif); letter-spacing: -.01em; }
.sheet-head p, .sheet-success p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--vx-ink2); }
.sheet-close { width: 34px; height: 34px; border-radius: 8px; border: 0; background: transparent; color: var(--vx-ink3); display: grid; place-items: center; cursor: pointer; flex: none; }
.sheet-close:hover { color: var(--vx-ink); background: rgba(255, 255, 255, .07); }
.sheet-close svg { width: 18px; height: 18px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.sheet-success { display: none; text-align: center; }
.sheet.is-done .sheet-success { display: block; }
.sheet.is-done .sheet-head, .sheet.is-done #resetForm { display: none; }
.sheet-success .ok { width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 18px; display: grid; place-items: center; background: rgba(61, 213, 152, .16); color: var(--vx-success); }
.sheet-success .ok svg { width: 26px; height: 26px; }
.sheet-success .sheet-actions { justify-content: center; margin-top: 20px; }
@keyframes vxin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- Toasts ---------- */
.toast-stack { position: fixed; z-index: 250; right: 16px; bottom: 16px; display: grid; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.toast {
    position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 16px;
    border-radius: 14px; background: #322F37; border: 1px solid var(--vx-line); color: var(--vx-ink);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .4); animation: vxin .25s cubic-bezier(.2, .7, .2, 1);
}
.toast.is-leaving { opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.t-ico { width: 20px; height: 20px; flex: none; color: var(--vx-accent); }
.t-ico svg { width: 20px; height: 20px; display: block; }
.toast[data-tone="danger"] .t-ico { color: var(--vx-danger); }
.toast[data-tone="success"] .t-ico { color: var(--vx-success); }
.toast[data-tone="warning"] .t-ico { color: var(--vx-warn); }
.t-body { flex: 1; min-width: 0; }
.t-title { font-size: 14px; font-weight: 600; }
.t-msg { font-size: 13px; color: var(--vx-ink2); margin-top: 3px; line-height: 1.45; }
.t-close { width: 26px; height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--vx-ink3); display: grid; place-items: center; cursor: pointer; flex: none; }
.t-close:hover { color: var(--vx-ink); background: rgba(255, 255, 255, .07); }
.t-close svg { width: 15px; height: 15px; }
.t-bar { position: absolute; left: 0; bottom: 0; height: 2px; width: 100%; background: currentColor; opacity: .35; transform-origin: left; animation: vxbar var(--t-dur, 4500ms) linear forwards; }
.toast[data-tone="danger"] .t-bar { color: var(--vx-danger); }
.toast[data-tone="success"] .t-bar { color: var(--vx-success); }
@keyframes vxbar { to { transform: scaleX(0); } }

/* Desktop: keep the voices panel in view while a long form scrolls */
@media (min-width: 961px) {
    .vx-voices { position: sticky; top: 0; height: 100vh; height: 100svh; }
}

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
    .vx-shell { grid-template-columns: 1fr; }
    .vx-formside { order: -1; padding: 20px 16px 8px; }
    .vx-card { padding: 28px 20px; }
    .vx-card-brand { display: flex; justify-content: center; margin: 0 0 22px; }
    .vx-card-brand img { height: 28px; width: auto; display: block; }
    .vx-voices { padding: 32px 20px 40px; border-top: 1px solid var(--vx-line); }
    .vx-voices > .vx-brand { display: none; }
    .vx-slides { min-height: 0; }
    .vx-metric { margin-left: 0; }
}
@media (max-width: 640px) {
    .control input { font-size: 16px; }
    .vx-title { font-size: 28px; }
    .toast-stack { left: 16px; right: 16px; width: auto; }
}

/* ---------- Reduced motion: no animation at all (carousel is stopped in voix.js) ---------- */
@media (prefers-reduced-motion: reduce) {
    .vx-slide, .vx-slide.on { transition: none; transform: none; }
    .vx-seg.on i::after { animation: none; width: 100%; }
    .sheet-panel, .toast { animation: none; }
    .btn-spinner { animation-duration: 1.6s; }
    .toast.is-leaving { transition: none; }
}
