@import url("./design-system.css");

/* =========================================================
   2. RESET + NỀN TẢNG
   ========================================================= */
* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.55 "Be Vietnam Pro", Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--ui-canvas);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

body.staff { background: var(--ui-canvas); }

body.customer .card,
body.staff .card,
body.customer .switch,
body.staff .switch,
body.customer .form-msg,
body.staff .form-msg,
body.customer .field input:not([type=checkbox]),
body.staff .field input:not([type=checkbox]),
body.customer .field textarea,
body.staff .field textarea {
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}

body.customer, body.staff { background: var(--ui-canvas); }

a { color: var(--pri); text-decoration: none; }
a:hover { text-decoration: underline; }
i { display: inline-flex; }

h1 { font-size: 28px; line-height: 1.2; margin: 24px 0 6px; letter-spacing: -.01em; }
h3 { font-size: 17px; margin: 6px 0 14px; }
.sub { color: var(--mut); margin: 0 0 26px; }

:focus-visible { outline: 3px solid var(--ui-focus); outline-offset: 3px; }

/* =========================================================
   3. BỐ CỤC TRANG ĐĂNG NHẬP (KHUNG TÂM)
   ========================================================= */
.auth {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(20px, 3vw, 52px);
}

.panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0;
}

.card {
  width: min(100%, 1180px);
  max-width: 1180px;
  min-height: 560px;
  background: linear-gradient(180deg, rgba(255,255,255,0.9) 0%, rgba(255,255,255,0.76) 100%);
  border: 1px solid rgba(255,255,255,0.82);
  border-radius: 30px;
  padding: clamp(28px, 2.8vw, 42px) clamp(28px, 3vw, 48px);
  box-shadow:
    0 28px 50px -28px rgba(15, 23, 42, 0.15),
    0 12px 24px -18px rgba(255,255,255,0.9),
    inset 0 1px 0 rgba(255,255,255,0.9);
  backdrop-filter: blur(24px) saturate(1.45);
  -webkit-backdrop-filter: blur(24px) saturate(1.45);
  animation: in .55s cubic-bezier(.16, 1, .3, 1);
  transform: none !important;
}

.auth-card {
  width: min(100%, 1100px);
  max-width: 1100px;
}

.auth-landing .card {
  width: min(100%, 980px);
  max-width: 980px;
  min-height: 0;
}

.launcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.launcher-intro {
  text-align: center;
  margin: 0 auto 28px;
  max-width: 620px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: 11px;
  line-height: 1;
  font-weight: 700;
  color: var(--mut);
  padding: 8px 12px;
  border: 1px solid rgba(17, 24, 39, 0.07);
  border-radius: 999px;
  background: rgba(255,255,255,0.34);
}

.role-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.role-card {
  display: grid;
  gap: 18px;
  align-content: space-between;
  min-height: 220px;
  padding: 22px 18px 18px;
  border-radius: 22px;
  border: 1px solid rgba(17,24,39,0.07);
  background: linear-gradient(180deg, rgba(255,255,255,0.58), rgba(255,255,255,0.32));
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.72), 0 18px 30px -28px rgba(15,23,42,0.18);
  color: var(--ink);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.role-card:hover {
  text-decoration: none;
  border-color: rgba(17,24,39,0.12);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 22px 40px -28px rgba(15,23,42,0.22);
  transform: none;
}

.role-actions {
  display: grid;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(17,24,39,0.06);
}

.role-actions .role-action {
  margin: 0;
  padding: 4px 0;
  border: 0;
}

.role-actions .role-action.secondary {
  color: var(--mut);
  font-size: 14px;
}

.gateway-note {
  margin: 22px 0 0;
  color: var(--mut);
  font-size: 13px;
  text-align: center;
}

.error-card {
  width: min(100%, 620px);
  max-width: 620px;
  min-height: 0;
}

.role-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(17,24,39,0.06), rgba(17,24,39,0.02));
  border: 1px solid rgba(17,24,39,0.06);
  color: var(--pri);
}

.role-icon.customer { background: linear-gradient(180deg, rgba(17,24,39,0.08), rgba(255,255,255,0.24)); }
.role-icon.staff { background: linear-gradient(180deg, rgba(148,163,184,0.18), rgba(255,255,255,0.3)); }
.role-icon.owner { background: linear-gradient(180deg, rgba(15,23,42,0.1), rgba(255,255,255,0.28)); }

.role-meta {
  display: grid;
  gap: 6px;
}

.role-meta strong {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -.02em;
}

.role-meta small {
  color: var(--mut);
  line-height: 1.5;
}

.role-action {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(17,24,39,0.06);
  font-weight: 600;
  color: var(--pri);
}

/* =========================================================
   4. CỘT GIỚI THIỆU (.visual) – ẨN TẠI AUTH BARU
   ========================================================= */
.visual {
  display: none !important;
}

.visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,0.82), transparent 22%),
    radial-gradient(circle at 80% 72%, rgba(255,255,255,0.68), transparent 30%),
    linear-gradient(135deg, rgba(255,255,255,0.25), transparent 55%);
  -webkit-mask-image: linear-gradient(160deg, #000 0%, transparent 72%);
          mask-image: linear-gradient(160deg, #000 0%, transparent 72%);
  pointer-events: none;
}

.visual > * { position: relative; }

.staff .visual {
  background:
    linear-gradient(rgba(255, 255, 255, .5) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .5) 1px, transparent 1px),
    linear-gradient(135deg, rgba(255,255,255,0.72), rgba(236,240,244,0.9));
  background-size: 40px 40px, 40px 40px, cover;
  border-right: 1px solid var(--line);
  color: var(--ink);
}
.staff .visual::before { display: none; }

.visual h2 {
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.18;
  letter-spacing: -.015em;
  margin: 0;
  max-width: 440px;
}

/* Danh sách các bước: có đường nối dọc giữa các icon */
.visual ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 440px;
}

.visual li {
  position: relative;
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 0 0 28px;
}
.visual li:last-child { padding-bottom: 0; }

.visual li::after {
  content: "";
  position: absolute;
  left: 21px;
  top: 48px;
  bottom: 4px;
  width: 2px;
  background: rgba(255, 255, 255, .25);
}
.visual li:last-child::after { display: none; }

.visual li > i {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
}

.visual li > span { padding-top: 2px; }
.visual li b { display: block; font-size: 16px; font-weight: 600; }
.visual li small { display: block; margin-top: 2px; opacity: .78; font-size: 14px; }

/* =========================================================
   5. THƯƠNG HIỆU
   ========================================================= */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 20px;
  color: inherit;
}
.brand:hover { text-decoration: none; }
.brand small { display: block; font-weight: 400; font-size: 12px; color: var(--mut); }

.logo {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--pri);
  color: #fff;
}

/* =========================================================
   6. FORM
   ========================================================= */
.field { margin-bottom: 6px; }

.field label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 6px;
}
.field label.chk { display: flex; }

form {
  display: grid;
  gap: 16px;
}

form .row,
form .field,
form .between,
form .btn,
form .form-msg {
  width: 100%;
}

.required-hint {
  display: block;
  margin-top: 4px;
  color: var(--mut);
  font-size: 12px;
  line-height: 1.35;
}

.field {
  position: relative;
  padding: 10px 10px 0;
  border-radius: 20px;
  background: linear-gradient(180deg, var(--cell) 0%, var(--cell-strong) 100%);
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 12px 18px -22px rgba(15,23,42,0.18);
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.field:has(input:focus),
.field:has(textarea:focus),
.field:has(.pw:focus-within) {
  border-color: rgba(17, 24, 39, 0.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 20px 28px -24px rgba(15,23,42,0.18);
}

.field input:not([type=checkbox]),
.field textarea {
  width: 100%;
  height: 54px;
  padding: 0 16px;
  border: 1px solid rgba(17, 24, 39, 0.12);
  border-radius: 16px;
  background: rgba(255,255,255,0.88);
  color: inherit;
  font: inherit;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.98), 0 12px 22px -24px rgba(15,23,42,0.2);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease, transform .2s ease, filter .2s ease;
}
.field input::placeholder,
.field textarea::placeholder { color: rgba(95,104,117,0.9); opacity: 1; }
.field input:not([type=checkbox]):hover,
.field textarea:hover { border-color: rgba(17,24,39,0.2); background: rgba(255,255,255,0.94); }

.field textarea { height: 92px; padding: 12px 16px; resize: vertical; }

.field input:focus,
.field textarea:focus {
  outline: 0;
  border-color: rgba(17,24,39,0.26);
  background: rgba(255,255,255,0.96);
  box-shadow: 0 0 0 4px rgba(15,23,42,0.06), inset 0 1px 0 rgba(255,255,255,0.98);
}

.err { min-height: 20px; margin: 4px 0 0; font-size: 13px; color: var(--err); }
.invalid input,
.invalid textarea { border-color: var(--err); }

fieldset.address-fields {
  min-width: 0;
  margin: 18px 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
fieldset.address-fields legend { padding: 0 6px; font-weight: 600; font-size: 14px; }

/* Ô mật khẩu + nút con mắt */
.pw { position: relative; }
.pw input { padding-right: 48px !important; }

.eye {
  position: absolute;
  right: 4px;
  top: 4px;
  width: 42px;
  height: 42px;
  border: 0;
  background: none;
  color: var(--mut);
  cursor: pointer;
  border-radius: 10px;
}
.eye:hover { color: var(--ink); background: var(--soft); }

/* Hàng "Ghi nhớ" + "Quên mật khẩu" */
.between {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin: 4px 0 18px;
  padding: 10px 6px 0;
  font-size: 14px;
}

.chk {
  display: flex;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  font-size: 14px;
  padding: 8px 10px;
  border-radius: 12px;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(17,24,39,0.05);
}
.chk input { width: 18px; height: 18px; accent-color: var(--pri); }

/* Thông báo form */
.form-msg {
  display: none;
  padding: 10px 14px;
  border-radius: 10px;
  background: rgba(217, 58, 58, .12);
  color: var(--err);
  font-size: 14px;
  margin: 0 0 14px;
}
.form-msg.show { display: block; }
.form-msg.success { background: rgba(22, 184, 154, .12); color: #087d69; }

/* =========================================================
   7. NÚT
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 54px;
  border: 1px solid rgba(17,24,39,0.06);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(17,17,17,0.98), rgba(25,27,31,0.98));
  color: #fff;
  font: 600 16px inherit;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 24px 28px -22px rgba(17,17,17,0.5), inset 0 1px 0 rgba(255,255,255,0.16);
  transition: transform .2s ease, box-shadow .2s ease, opacity .2s ease, filter .2s ease;
}
.btn:hover {
  background: linear-gradient(180deg, rgba(24,24,26,0.99), rgba(35,36,40,0.99));
  transform: none;
  box-shadow: 0 26px 32px -24px rgba(17,17,17,0.62), inset 0 1px 0 rgba(255,255,255,0.2);
  filter: brightness(1.04);
  text-decoration: none;
}
.btn:active { transform: none; box-shadow: none; }

.btn.ghost { background: rgba(255,255,255,0.28); color: var(--ink); border-color: rgba(17,24,39,0.08); }
.btn.ghost:hover { background: rgba(255,255,255,0.46); box-shadow: 0 16px 22px -18px rgba(17,24,39,0.14); }

.btn[aria-busy=true] { pointer-events: none; opacity: .8; }
.btn[aria-busy=true]:after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid #fff;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}

/* =========================================================
   8. THÀNH PHẦN PHỤ (đăng ký, quản trị, v.v.)
   ========================================================= */
.or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--mut);
  margin: 22px 0;
  font-size: 14px;
}
.or:before,
.or:after { content: ""; flex: 1; height: 1px; background: var(--line); }

.g { color: var(--ui-accent); font-size: 20px; }
.note { font-size: 12.5px; color: var(--mut); text-align: center; margin: 8px 0 18px; }
.center { text-align: center; margin: 22px 0 0; color: var(--mut); font-size: 15px; }
.center a { color: var(--pri); }

/* Khối chuyển sang đăng nhập quản trị */
.switch {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  margin-top: 24px;
  border: 1px solid rgba(255,255,255,0.8);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255,255,255,0.32), rgba(255,255,255,0.16));
  backdrop-filter: blur(16px) saturate(1.5);
  -webkit-backdrop-filter: blur(16px) saturate(1.5);
  color: var(--ink);
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82), 0 14px 24px -22px rgba(15,23,42,0.12);
  transition: transform .22s cubic-bezier(.2,.9,.2,1), border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.switch:hover {
  text-decoration: none;
  border-color: rgba(17,24,39,0.08);
  background: linear-gradient(180deg, rgba(255,255,255,0.42), rgba(255,255,255,0.22));
  box-shadow: 0 18px 32px -24px rgba(15,23,42,0.16), inset 0 1px 0 rgba(255,255,255,0.9);
  transform: none;
}

.btn:hover {
  background: linear-gradient(180deg, rgba(24,24,26,0.99), rgba(35,36,40,0.99));
  transform: none;
  box-shadow: 0 26px 32px -24px rgba(17,17,17,0.62), inset 0 1px 0 rgba(255,255,255,0.2);
  filter: brightness(1.04);
  text-decoration: none;
}

.switch:hover,
.btn:hover,
.eye:hover,
.field input:not([type=checkbox]):hover,
.field textarea:hover {
  animation: none;
}

.switch:hover {
  transform: none;
}

.btn:hover {
  animation: none;
}

.eye:hover {
  transform: none;
}

.switch span:nth-child(2) { flex: 1; }
.switch b { display: block; font-weight: 600; }
.switch small { display: block; color: var(--mut); font-size: 13px; }

.ic {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--card);
  flex: none;
}

.back { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; color: var(--mut); }
.lockline {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  color: var(--mut);
  font-size: 13px;
  margin-top: 18px;
}

/* =========================================================
   9. TRANG NHIỀU BƯỚC (wrap / steps / row / dl)
   ========================================================= */
.wrap { max-width: 800px; margin: 0 auto; padding: 28px 20px 64px; }
.wrap .card { max-width: none; margin-top: 16px; }

.steps { display: flex; gap: 8px; margin: 20px 0 26px; padding: 0; list-style: none; }
.steps li {
  flex: 1;
  font-size: 13px;
  color: var(--mut);
  border-top: 4px solid var(--line);
  padding-top: 8px;
  transition: .3s;
}
.steps li.on { color: var(--ink); font-weight: 600; border-color: var(--pri); }
.steps li.done { border-color: var(--acc); }

[data-step] { display: none; }
[data-step].on { display: block; animation: in .3s ease; }

.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0 18px;
}

.row > .field + .field {
  position: relative;
}

.row > .field + .field::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 18px;
  bottom: 18px;
  width: 1px;
  background: linear-gradient(180deg, transparent, rgba(17,24,39,0.12), transparent);
}

.drop {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 12px;
  color: var(--mut);
  cursor: pointer;
  margin-bottom: 14px;
  font-size: 14px;
  transition: .15s;
}
.drop:hover,
.drop:focus-within { border-color: var(--pri); background: var(--soft); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }

.box {
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--soft);
  font-size: 14px;
  color: var(--mut);
  margin-bottom: 16px;
}

dl { display: grid; grid-template-columns: 150px 1fr; gap: 8px 16px; margin: 0 0 18px; font-size: 15px; }
dt { color: var(--mut); }
dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.actions { display: flex; gap: 12px; justify-content: space-between; margin-top: 18px; }
.actions .btn { width: auto; min-width: 150px; padding: 0 24px; }

/* =========================================================
   10. ANIMATION
   ========================================================= */
@keyframes in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.985);
    filter: blur(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}
@keyframes spin { to { transform: rotate(360deg); } }

@keyframes floatGlow {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50% { transform: translate3d(0, -5px, 0); }
}

@keyframes subtlePulse {
  0%, 100% { box-shadow: 0 14px 18px -18px rgba(15, 23, 42, 0.18); }
  50% { box-shadow: 0 18px 26px -18px rgba(15, 23, 42, 0.28); }
}

body.customer .card,
body.customer .switch,
body.staff .card,
body.staff .switch {
  animation: in .55s cubic-bezier(.16, 1, .3, 1);
}

/* =========================================================
   11. RESPONSIVE
   ========================================================= */
@media (max-width: 900px) {
  .auth {
    padding: 24px 18px;
  }
  .card {
    width: min(100%, 860px);
    min-height: 0;
    max-width: 860px;
  }
  .visual {
    padding: 28px 22px;
  }
  .panel { padding: 0; align-items: start; }
}

@media (max-width: 600px) {
  .auth {
    padding: 18px 12px;
  }
  .row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .role-grid {
    grid-template-columns: 1fr;
  }
  .row > .field + .field::before {
    left: -6px;
    top: 14px;
    bottom: 14px;
  }
  .between {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }
  .card { padding: 20px 16px; border-radius: 22px; }
  h1 { font-size: 24px; }
  .field {
    padding: 8px 8px 0;
    border-radius: 16px;
  }
  .field input:not([type=checkbox]),
  .field textarea {
    height: 48px;
    border-radius: 14px;
  }
  .btn { height: 50px; }
  dl { grid-template-columns: 1fr; gap: 2px; }
  dd { margin-bottom: 8px; }
  .actions .btn { flex: 1; min-width: 0; }
  .role-card { min-height: 0; }
}

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

/* Unified, compact auth and gateway presentation. */
:root {
  --bg: var(--ui-canvas);
  --bg-2: var(--ui-canvas-raised);
  --card: var(--ui-surface);
  --card-strong: var(--ui-surface-strong);
  --card-soft: var(--ui-surface-soft);
  --cell: var(--ui-surface);
  --cell-strong: var(--ui-surface-strong);
  --ink: var(--ui-ink);
  --mut: var(--ui-muted);
  --line: var(--ui-border);
  --pri: var(--ui-accent);
  --pri2: var(--ui-accent-hover);
  --soft: var(--ui-accent-soft);
  --acc: var(--ui-muted);
  --err: var(--ui-danger-ink);
  --shadow: rgba(24, 28, 34, .08);
  --radius: var(--ui-card-radius);
  --input-bg: var(--ui-surface-strong);
  --input-border: var(--ui-border-strong);
  --input-shadow: rgba(24, 28, 34, .04);
}

body.customer, body.staff {
  --bg: var(--ui-canvas);
  --bg-2: var(--ui-canvas-raised);
  --card: var(--ui-surface);
  --card-strong: var(--ui-surface-strong);
  --card-soft: var(--ui-surface-soft);
  --cell: var(--ui-surface);
  --cell-strong: var(--ui-surface-strong);
  --ink: var(--ui-ink);
  --mut: var(--ui-muted);
  --line: var(--ui-border);
  --pri: var(--ui-accent);
  --pri2: var(--ui-accent-hover);
  --soft: var(--ui-accent-soft);
  --acc: var(--ui-muted);
  --err: var(--ui-danger-ink);
  --shadow: rgba(24, 28, 34, .08);
  --input-bg: var(--ui-surface-strong);
  --input-border: var(--ui-border-strong);
  --input-shadow: rgba(24, 28, 34, .04);
}

body, body.customer, body.staff {
  background:
    radial-gradient(ellipse at 8% 0, rgba(255, 255, 255, .9), transparent 34rem),
    linear-gradient(145deg, var(--ui-canvas-raised), var(--ui-canvas));
}

.auth { padding: clamp(20px, 4vw, 56px); }
.panel { width: 100%; }
.card, .auth-card {
  min-height: 0;
  border: 1px solid var(--ui-border);
  border-radius: 22px;
  background: var(--ui-surface-strong);
  box-shadow: var(--ui-shadow-card);
  backdrop-filter: blur(18px) saturate(1.15);
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
}
.auth-card { width: min(100%, 960px); max-width: 960px; padding: clamp(26px, 4vw, 44px); }
.auth-card:has(#profile-form) { width: min(100%, 820px); max-width: 820px; }
.auth-landing .card { width: min(100%, 1060px); max-width: 1060px; }
.auth-header { margin-bottom: 18px; }
.auth-card h1 { margin: 12px 0 7px; color: var(--ink); font-size: clamp(26px, 3vw, 34px); letter-spacing: -.04em; }
.auth-card > .sub { margin-bottom: 24px; }
.auth-card form { gap: 13px; }
.row { gap: 0 18px; }
.row > .field + .field::before { display: none; }
.field {
  margin: 0 0 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
.field:has(input:focus), .field:has(textarea:focus), .field:has(.pw:focus-within) {
  border: 0;
  box-shadow: none;
}
.field label { margin-bottom: 6px; color: var(--ui-ink); font-size: 13px; }
.required-hint { color: var(--ui-muted); font-size: 11px; }
.field input:not([type=checkbox]), .field textarea {
  height: 46px;
  padding: 0 13px;
  border: 1px solid var(--input-border);
  border-radius: var(--ui-control-radius);
  background: var(--ui-surface-strong);
  box-shadow: none;
}
.field input:not([type=checkbox]):hover, .field textarea:hover { border-color: var(--ui-border-strong); background: #fff; }
.field input:focus, .field textarea:focus {
  border-color: var(--ui-accent);
  background: #fff;
  box-shadow: 0 0 0 3px var(--ui-focus);
}
.eye { top: 2px; right: 2px; height: 42px; }
.between { margin: 0 0 4px; padding: 0; }
.chk { border: 0; background: transparent; }
.btn {
  min-height: 48px;
  height: auto;
  border: 0;
  border-radius: var(--ui-control-radius);
  background: var(--pri);
  box-shadow: none;
}
.btn:hover { background: var(--pri2); box-shadow: 0 8px 18px rgba(24, 28, 34, .16); }
.btn.ghost { border: 1px solid var(--line); background: #fff; }
.btn.ghost:hover { background: var(--ui-accent-soft); }
.switch { border: 1px solid var(--line); border-radius: 13px; background: var(--ui-surface-soft); box-shadow: none; }
.switch:hover { border-color: var(--ui-border-strong); background: var(--ui-accent-soft); box-shadow: none; }
.ic { border-radius: 11px; background: var(--ui-accent-soft); color: var(--pri); }
.logo { border-radius: 11px; background: var(--pri); }
.role-grid { gap: 16px; }
.role-card {
  min-height: 196px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-soft);
}
.role-card:hover { border-color: var(--ui-border-strong); box-shadow: var(--ui-shadow-card); }
.role-icon { border-color: var(--ui-border); border-radius: 13px; background: var(--ui-accent-soft); color: var(--pri); }
.role-icon.customer, .role-icon.staff, .role-icon.owner { background: var(--ui-accent-soft); }
.role-action { border-color: var(--line); color: var(--pri); }
.role-actions { border-color: var(--line); }
.role-actions .role-action.secondary { color: var(--mut); }
.eyebrow { border-color: var(--ui-border); background: var(--ui-accent-soft); color: var(--pri); }
.gateway-note { margin-top: 18px; }
.form-msg { border: 1px solid #f3d4d8; border-radius: 10px; }
.form-msg.success { border-color: var(--ui-border-strong); background: var(--ui-success-surface); color: var(--ui-success-ink); }
fieldset.address-fields { border-color: var(--line); border-radius: 13px; }

@media (max-width: 760px) {
  .auth { align-items: flex-start; padding: 20px 14px; }
  .auth-card { padding: 24px; }
  .role-grid { grid-template-columns: 1fr; }
  .role-card { min-height: 0; }
}

@media (max-width: 600px) {
  .field { padding: 0; }
  .field input:not([type=checkbox]), .field textarea { height: 46px; border-radius: 10px; }
  .btn { min-height: 48px; }
}

body.customer,
body.staff {
  background: var(--ui-canvas);
}

.auth-landing {
  min-height: 100vh;
  background: var(--ui-canvas);
}

.auth-landing .launcher-card {
  position: relative;
  width: min(100%, 1060px);
  max-width: 1060px;
  overflow: hidden;
  border: 1px solid var(--ui-border);
  border-radius: 18px;
  background: var(--ui-surface);
  box-shadow: var(--ui-shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.auth-landing .launcher-card::before {
  position: absolute;
  inset: 0 0 auto;
  height: 5px;
  background: linear-gradient(90deg, #a8171c, var(--ui-accent), var(--ui-orange));
  content: "";
}

.auth-landing .launcher-header {
  margin-bottom: 26px;
}

.auth-landing .launcher-intro {
  margin-bottom: 30px;
}

.auth-landing .launcher-intro h1 {
  margin: 15px 0 7px;
  color: var(--ui-ink);
  font-size: clamp(30px, 4vw, 40px);
  letter-spacing: -.045em;
}

.auth-landing .launcher-intro .sub {
  margin: 0;
  color: var(--ui-muted);
}

.auth-landing .eyebrow {
  border-color: rgba(243, 111, 33, .2);
  background: #fff5ef;
  color: var(--ui-accent);
}

.auth-landing .role-grid {
  gap: 14px;
}

.auth-landing .role-card {
  min-width: 0;
  min-height: 210px;
  gap: 15px;
  padding: 20px;
  border: 1px solid var(--ui-border);
  border-radius: 16px;
  background: #fff;
  box-shadow: var(--ui-shadow-soft);
}

.auth-landing .role-card:hover {
  border-color: rgba(203, 28, 34, .3);
  box-shadow: var(--ui-shadow-card);
  transform: translateY(-2px);
}

.auth-landing .role-icon {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(203, 28, 34, .1);
  border-radius: 13px;
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.auth-landing .role-icon.staff {
  border-color: rgba(49, 87, 136, .12);
  background: #edf3fc;
  color: #315788;
}

.auth-landing .role-icon.owner {
  border-color: rgba(243, 111, 33, .18);
  background: #fff2e9;
  color: #d85b17;
}

.auth-landing .role-meta strong {
  color: var(--ui-ink);
  font-size: 16px;
}

.auth-landing .role-meta small {
  color: var(--ui-muted);
  line-height: 1.55;
}

.auth-landing .role-actions {
  border-color: var(--ui-border);
}

.auth-landing .role-action {
  display: flex;
  min-height: 40px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 11px;
  border: 1px solid var(--ui-accent);
  border-radius: 9px;
  background: var(--ui-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background var(--ui-transition), border-color var(--ui-transition), transform var(--ui-transition);
}

.auth-landing .role-action:hover {
  transform: translateY(-1px);
  border-color: var(--ui-accent-hover);
  background: var(--ui-accent-hover);
  color: #fff;
}

.auth-landing .role-actions .role-action.secondary {
  border-color: var(--ui-border-strong);
  background: #fff;
  color: var(--ui-ink);
}

.auth-landing .role-actions .role-action.secondary:hover {
  border-color: var(--ui-accent);
  background: var(--ui-accent-soft);
  color: var(--ui-accent);
}

.auth-landing .gateway-note {
  margin: 22px 0 0;
  color: var(--ui-muted);
  font-size: 12px;
  text-align: center;
}

@media (max-width: 760px) {
  .auth-landing .launcher-card {
    padding: 26px 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-landing .role-card,
  .auth-landing .role-action {
    transition: none;
  }
}

.error-card {
  width: min(100%, 690px);
  max-width: 690px;
  min-height: 560px;
  padding: clamp(28px, 5vw, 48px);
  text-align: center;
}

.error-code {
  display: block;
  margin-bottom: 4px;
  color: var(--ui-accent);
  font-size: clamp(52px, 8vw, 68px);
  font-weight: 750;
  letter-spacing: -.055em;
  line-height: 1;
}

.error-card h1 {
  margin: 0 0 8px;
  color: var(--ui-ink);
  font-size: clamp(20px, 3vw, 24px);
  letter-spacing: -.025em;
}

.error-card .sub {
  margin: 0 auto 20px;
  color: var(--ui-muted);
  font-size: 13px;
  line-height: 1.55;
}

.error-card .btn {
  min-height: 40px;
  border-radius: 7px;
  box-shadow: none;
}

.error-card .actions {
  justify-content: center;
  gap: 10px;
  margin-top: 0;
}

.error-card .actions .btn {
  min-width: 160px;
}

@media (max-width: 520px) {
  .error-card {
    min-height: 0;
    padding: 28px 20px;
  }

  .error-card .actions {
    flex-direction: column;
  }

  .error-card .actions .btn {
    width: 100%;
  }
}