/* ============================================================================
   Unicity Orders — Asstio portal
   "Violet aurora" premium dark theme. Brand: Asstio #6D3EFF + Plus Jakarta Sans,
   paired with a Fraunces editorial display face.
   ============================================================================ */

:root {
  --violet:        #6d3eff;
  --violet-bright: #8b5cff;
  --violet-300:    #b9a6ff;
  --violet-glow:   rgba(109, 62, 255, 0.55);
  --magenta:       #ff4d9d;

  --bg:      #07060f;
  --bg-2:    #0d0b1c;
  --ink:     #efecff;
  --muted:   #9a93c4;
  --muted-2: #6f689a;

  --card:        rgba(19, 15, 38, 0.55);
  --card-solid:  #120e26;
  --border:      rgba(150, 130, 255, 0.16);
  --border-soft: rgba(150, 130, 255, 0.10);

  --ok:   #4ade80;
  --warn: #fbbf24;
  --bad:  #fb7185;

  --display: "Fraunces", "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  position: relative;
  overflow-x: hidden;
}

/* --- Atmosphere: aurora mesh + grain + vignette ------------------------- */
.aurora {
  position: fixed;
  inset: -20%;
  z-index: -2;
  background:
    radial-gradient(40% 50% at 18% 22%, rgba(109, 62, 255, 0.42), transparent 60%),
    radial-gradient(36% 44% at 82% 18%, rgba(255, 77, 157, 0.20), transparent 58%),
    radial-gradient(50% 55% at 70% 88%, rgba(80, 70, 220, 0.34), transparent 62%),
    radial-gradient(45% 40% at 30% 90%, rgba(34, 211, 238, 0.10), transparent 60%);
  filter: blur(20px) saturate(125%);
  animation: drift 24s var(--ease) infinite alternate;
}
.aurora::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 120% at 50% 0%, transparent 55%, var(--bg) 100%);
}
@keyframes drift {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  100% { transform: translate3d(0, -4%, 0) scale(1.08); }
}
.grain {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* --- Brand mark --------------------------------------------------------- */
.mark { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.mark__glyph {
  width: 34px; height: 34px; border-radius: 9px;
  background: #fff;
  display: grid; place-items: center;
  box-shadow: 0 6px 22px var(--violet-glow);
  flex: none;
}
.mark__glyph svg { width: 22px; height: 22px; display: block; }
.mark__name { font-weight: 700; letter-spacing: -0.02em; font-size: 1.02rem; }
.mark__name span { color: var(--violet-300); }

/* --- Layout shells ------------------------------------------------------ */
.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(8px);
}
.topbar__user { display: flex; align-items: center; gap: 16px; font-size: 0.9rem; color: var(--muted); }
.topbar__user b { color: var(--ink); font-weight: 600; }

.center { flex: 1; display: grid; place-items: center; padding: clamp(28px, 6vw, 80px) 20px; }

.footer {
  text-align: center; padding: 26px; color: var(--muted-2);
  font-size: 0.8rem; letter-spacing: 0.01em;
}
.footer a { color: var(--violet-300); text-decoration: none; }
.footer a:hover { color: var(--ink); }

/* --- Card --------------------------------------------------------------- */
.card {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(26px) saturate(140%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    0 40px 90px -30px rgba(0, 0, 0, 0.8),
    0 0 0 1px rgba(255, 255, 255, 0.02);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; inset: 0; pointer-events: none;
  background: radial-gradient(80% 50% at 50% -10%, rgba(139, 92, 255, 0.18), transparent 70%);
}

/* --- Login page --------------------------------------------------------- */
.login { max-width: 560px; padding: clamp(32px, 5vw, 56px); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--violet-300);
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(109, 62, 255, 0.08);
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--violet-bright); box-shadow: 0 0 12px var(--violet-bright);
}
.login h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.6rem, 7vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 24px 0 14px;
  font-optical-sizing: auto;
}
.login h1 em {
  font-style: italic;
  background: linear-gradient(100deg, var(--violet-bright), var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.login p.lede { color: var(--muted); font-size: 1.06rem; max-width: 44ch; margin: 0 auto 18px; }

.steps {
  list-style: none; display: grid; gap: 10px; text-align: left;
  margin: 26px auto 32px; max-width: 380px;
}
.steps li { display: flex; gap: 14px; align-items: flex-start; color: var(--muted); font-size: 0.95rem; }
.steps li b { color: var(--ink); font-weight: 600; }
.steps .num {
  flex: none; width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-size: 0.8rem; font-weight: 700;
  color: var(--violet-300); background: rgba(109, 62, 255, 0.12);
  border: 1px solid var(--border);
}

/* Asstio ID button */
.asstio-btn {
  display: inline-block; line-height: 0; border-radius: 28px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), filter 0.35s var(--ease);
  box-shadow: 0 14px 34px -10px var(--violet-glow);
}
.asstio-btn:hover { transform: translateY(-3px) scale(1.015); box-shadow: 0 22px 50px -12px var(--violet-glow); filter: brightness(1.06); }
.asstio-btn:active { transform: translateY(-1px) scale(0.99); }
.asstio-btn:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 4px; }
.asstio-btn img { height: 52px; display: block; pointer-events: none; }

.fineprint { margin-top: 22px; color: var(--muted-2); font-size: 0.82rem; }

/* --- Buttons (generic) -------------------------------------------------- */
.btn {
  font-family: var(--sans); font-weight: 600; font-size: 0.98rem;
  border: none; cursor: pointer; border-radius: 14px;
  padding: 14px 24px; letter-spacing: -0.01em;
  transition: transform 0.25s var(--ease), box-shadow 0.25s var(--ease), background 0.25s var(--ease);
  display: inline-flex; align-items: center; gap: 10px;
}
.btn--primary {
  color: #fff;
  background: linear-gradient(180deg, var(--violet-bright), var(--violet));
  box-shadow: 0 12px 30px -10px var(--violet-glow), 0 1px 0 rgba(255,255,255,0.25) inset;
}
.btn--primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 20px 44px -12px var(--violet-glow), 0 1px 0 rgba(255,255,255,0.25) inset; }
.btn--primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn--ghost {
  color: var(--violet-300); background: transparent;
  border: 1px solid var(--border); padding: 9px 16px; font-size: 0.86rem; border-radius: 11px;
}
.btn--ghost:hover { color: var(--ink); border-color: var(--violet); background: rgba(109,62,255,0.08); }
.btn:focus-visible { outline: 2px solid var(--violet-bright); outline-offset: 3px; }

/* --- Upload page -------------------------------------------------------- */
.import { width: 100%; max-width: 760px; }
.import__head { margin-bottom: 28px; }
.import__head h1 {
  font-family: var(--display); font-weight: 400; font-size: clamp(2rem, 5vw, 2.8rem);
  letter-spacing: -0.02em; line-height: 1.05; margin-bottom: 8px;
}
.import__head p { color: var(--muted); max-width: 56ch; }

.panel { padding: clamp(24px, 4vw, 38px); }

.dropzone {
  position: relative;
  border: 1.5px dashed rgba(150, 130, 255, 0.32);
  border-radius: 18px;
  padding: 48px 28px;
  text-align: center;
  background: rgba(109, 62, 255, 0.04);
  transition: border-color 0.3s var(--ease), background 0.3s var(--ease), transform 0.3s var(--ease);
  cursor: pointer;
}
.dropzone:hover { border-color: var(--violet); background: rgba(109, 62, 255, 0.08); }
.dropzone.is-drag { border-color: var(--violet-bright); background: rgba(109, 62, 255, 0.14); transform: scale(1.01); }
.dropzone.has-file { border-style: solid; border-color: var(--violet); background: rgba(109, 62, 255, 0.10); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.dropzone__icon {
  width: 56px; height: 56px; margin: 0 auto 16px; border-radius: 16px;
  display: grid; place-items: center; color: var(--violet-300);
  background: rgba(109, 62, 255, 0.12); border: 1px solid var(--border);
  transition: transform 0.3s var(--ease);
}
.dropzone.is-drag .dropzone__icon { transform: translateY(-4px); }
.dropzone__title { font-weight: 600; font-size: 1.08rem; }
.dropzone__title span { color: var(--violet-300); text-decoration: underline; text-underline-offset: 3px; }
.dropzone__hint { color: var(--muted-2); font-size: 0.85rem; margin-top: 6px; }
.dropzone__file { display: none; align-items: center; justify-content: center; gap: 10px; font-weight: 600; color: var(--ink); }
.dropzone.has-file .dropzone__file { display: flex; }
.dropzone.has-file .dropzone__prompt { display: none; }

.actions { display: flex; align-items: center; gap: 16px; margin-top: 22px; }
.actions .note { color: var(--muted-2); font-size: 0.82rem; }

/* Alerts */
.alert {
  margin-top: 22px; padding: 16px 18px; border-radius: 14px;
  display: flex; gap: 12px; align-items: flex-start; font-size: 0.94rem;
  border: 1px solid; animation: fadeUp 0.5s var(--ease) both;
}
.alert--error { color: #ffd9e2; background: rgba(251, 113, 133, 0.10); border-color: rgba(251, 113, 133, 0.32); }
.alert b { font-weight: 700; }

/* Result */
.result { margin-top: 30px; animation: fadeUp 0.5s var(--ease) both; }
.result h2 { font-family: var(--display); font-weight: 400; font-size: 1.5rem; margin-bottom: 16px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.stat {
  background: rgba(255, 255, 255, 0.025); border: 1px solid var(--border-soft);
  border-radius: 16px; padding: 18px 16px; text-align: center;
  animation: popIn 0.5s var(--ease) both;
}
.stat:nth-child(1) { animation-delay: 0.04s; }
.stat:nth-child(2) { animation-delay: 0.10s; }
.stat:nth-child(3) { animation-delay: 0.16s; }
.stat:nth-child(4) { animation-delay: 0.22s; }
.stat__num { font-family: var(--display); font-size: 2.1rem; line-height: 1; font-weight: 400; }
.stat__label { margin-top: 8px; font-size: 0.74rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted-2); }
.stat--ins .stat__num { color: var(--ok); }
.stat--upd .stat__num { color: var(--violet-300); }
.stat--dup .stat__num { color: var(--warn); }
.stat--skip .stat__num { color: var(--bad); }

.skipped { margin-top: 22px; }
.skipped h3 { font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }
.skipped ul { list-style: none; display: grid; gap: 6px; max-height: 220px; overflow-y: auto; }
.skipped li {
  display: flex; gap: 12px; font-size: 0.9rem; color: var(--muted);
  padding: 9px 14px; border-radius: 10px; background: rgba(251, 113, 133, 0.06);
  border: 1px solid rgba(251, 113, 133, 0.16);
}
.skipped li b { color: var(--bad); font-variant-numeric: tabular-nums; flex: none; }

/* --- Animations & entrance --------------------------------------------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes popIn  { from { opacity: 0; transform: translateY(10px) scale(0.96); } to { opacity: 1; transform: none; } }

[data-reveal] { animation: fadeUp 0.7s var(--ease) both; }
[data-reveal="1"] { animation-delay: 0.05s; }
[data-reveal="2"] { animation-delay: 0.14s; }
[data-reveal="3"] { animation-delay: 0.24s; }
[data-reveal="4"] { animation-delay: 0.34s; }
[data-reveal="5"] { animation-delay: 0.46s; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media (max-width: 520px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .topbar__user b { display: none; }
}
