:root {
  color-scheme: light;
  --ink: #111827;
  --ink-soft: #334155;
  --muted: #667085;
  --line: rgba(17, 24, 39, .10);
  --line-strong: rgba(74, 144, 226, .30);
  --surface: rgba(255, 255, 255, .82);
  --surface-solid: #fff;
  --soft: #f5f7fa;
  --blue: #4a90e2;
  --blue-dark: #276dbb;
  --violet: #6366f1;
  --green: #059669;
  --red: #b42318;
  --shadow: 0 20px 55px rgba(32, 53, 84, .13);
  --shadow-soft: 0 10px 30px rgba(32, 53, 84, .08);
  --motion-x: 0px;
  --motion-y: 0px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { min-width: 320px; min-height: 100%; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at calc(20% + var(--motion-x)) calc(10% + var(--motion-y)), rgba(74, 144, 226, .22), transparent 60%),
    radial-gradient(1000px 520px at calc(85% - var(--motion-x)) calc(20% - var(--motion-y)), rgba(99, 102, 241, .18), transparent 56%),
    linear-gradient(135deg, #f5f7fa 0%, #dfe7f3 52%, #c3cfe2 100%);
  background-attachment: fixed;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .22;
  background-image:
    linear-gradient(rgba(255,255,255,.35) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.35) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, #000, transparent 76%);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button, input, select { -webkit-tap-highlight-color: transparent; }
button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 3px solid rgba(74, 144, 226, .20);
  outline-offset: 2px;
}
.boot { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 16px; color: var(--muted); }
.boot-logo { width: 210px; height: auto; filter: drop-shadow(0 8px 18px rgba(17,24,39,.12)); }
.brand-logo { display: block; width: 174px; height: auto; }

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: rgba(255,255,255,.70);
  box-shadow: 0 4px 14px rgba(17,24,39,.06);
  backdrop-filter: blur(12px);
}
.language-switch button {
  min-width: 38px;
  height: 30px;
  padding: 0 9px;
  border: 0;
  border-radius: 9999px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  transition: .2s ease;
}
.language-switch button.active {
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  box-shadow: 0 5px 14px rgba(74,144,226,.28);
}

/* Sign-in landing */
.login {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(18px, 3vw, 42px);
}
.login::before, .login::after {
  content: "";
  position: absolute;
  pointer-events: none;
  border-radius: 50%;
  transition: transform .18s ease-out;
}
.login::before {
  width: min(38vw, 560px);
  aspect-ratio: 1;
  top: -24%;
  right: -7%;
  background: radial-gradient(circle at 35% 35%, rgba(255,255,255,.92), rgba(99,102,241,.22) 32%, rgba(74,144,226,.08) 58%, transparent 72%);
  transform: translate3d(calc(var(--motion-x) * .8), calc(var(--motion-y) * .8), 0);
  filter: blur(2px);
}
.login::after {
  width: min(32vw, 450px);
  aspect-ratio: 1;
  left: -12%;
  bottom: -28%;
  border: 1px solid rgba(255,255,255,.42);
  box-shadow: 0 0 0 70px rgba(255,255,255,.09), 0 0 0 140px rgba(255,255,255,.05);
  transform: translate3d(calc(var(--motion-x) * -.5), calc(var(--motion-y) * -.5), 0);
}
.login-shell {
  position: relative;
  z-index: 1;
  width: min(1220px, 100%);
  min-height: min(760px, calc(100vh - 84px));
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, .72fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 32px;
  background: rgba(255,255,255,.42);
  box-shadow: 0 30px 90px rgba(48,72,108,.18), inset 0 1px 0 rgba(255,255,255,.78);
  backdrop-filter: blur(22px);
  animation: portalIn .65s cubic-bezier(.2,.75,.25,1) both;
}
.login-visual {
  position: relative;
  min-width: 0;
  display: flex;
  padding: clamp(38px, 5vw, 72px);
  overflow: hidden;
  background:
    radial-gradient(520px 360px at 86% 4%, rgba(74,144,226,.19), transparent 64%),
    linear-gradient(145deg, rgba(255,255,255,.70), rgba(244,248,253,.42));
}
.login-visual::after {
  content: "";
  position: absolute;
  width: 360px;
  height: 360px;
  right: -170px;
  bottom: -170px;
  border: 1px solid rgba(74,144,226,.17);
  border-radius: 50%;
  box-shadow: 0 0 0 55px rgba(74,144,226,.035), 0 0 0 110px rgba(99,102,241,.025);
}
.login-copy {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
}
.login .brand { margin: 0; }
.login .brand-logo { width: clamp(190px, 22vw, 250px); filter: drop-shadow(0 7px 18px rgba(28,60,104,.12)); }
.login-hero { margin: auto 0; padding: 64px 0; max-width: 650px; }
.eyebrow {
  margin: 0 0 16px;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .11em;
  text-transform: uppercase;
}
.login h1 {
  max-width: 650px;
  margin: 0;
  color: #10254a;
  font-size: clamp(43px, 5.1vw, 72px);
  font-weight: 720;
  line-height: 1.02;
  letter-spacing: -.055em;
}
.login-description {
  max-width: 590px;
  margin: 26px 0 0;
  color: #4d607d;
  font-size: 17px;
  line-height: 1.7;
}
.product-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 30px; }
.product-cloud span {
  padding: 8px 13px;
  border: 1px solid rgba(74,144,226,.14);
  border-radius: 9999px;
  background: rgba(255,255,255,.62);
  color: #355272;
  font-size: 12px;
  font-weight: 650;
  box-shadow: 0 5px 16px rgba(44,78,118,.05);
}
.login-caption { margin: 0; color: #7a899d; font-size: 12px; letter-spacing: .025em; }
.login-panel {
  position: relative;
  display: grid;
  place-items: center;
  padding: clamp(40px, 5vw, 72px);
  border-left: 1px solid rgba(17,24,39,.075);
  background: rgba(255,255,255,.76);
}
.login-panel > .language-switch { position: absolute; top: 28px; right: 28px; }
.login-card { width: min(100%, 430px); }
.login-card-mark {
  display: grid;
  width: 50px;
  height: 50px;
  margin-bottom: 26px;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(74,144,226,.13), rgba(99,102,241,.16));
  color: var(--blue-dark);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .06em;
  box-shadow: inset 0 0 0 1px rgba(74,144,226,.12);
}
.login-card h2 { margin: 0 0 12px; color: #12213d; font-size: 31px; font-weight: 680; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 30px; color: var(--muted); font-size: 15px; line-height: 1.65; }

.primary, .secondary, .danger {
  width: 100%;
  min-height: 48px;
  padding: 0 19px;
  border-radius: 9999px;
  font-weight: 650;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background .2s ease;
}
.primary {
  border: 0;
  background: linear-gradient(135deg, var(--blue), var(--violet));
  color: #fff;
  box-shadow: 0 8px 22px rgba(74,144,226,.28);
}
.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 27px rgba(74,144,226,.36); }
.primary:active { transform: translateY(0); }
.secondary { border: 1px solid var(--line); background: rgba(255,255,255,.70); color: var(--ink); }
.secondary:hover { border-color: rgba(74,144,226,.34); background: rgba(255,255,255,.95); color: var(--blue-dark); }
.danger { border: 1px solid #ffd1cb; background: #fff5f3; color: var(--red); }
.inline-form input {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  background: rgba(255,255,255,.72);
  color: var(--ink);
  transition: .2s ease;
}
.inline-form input:focus { border-color: rgba(74,144,226,.54); box-shadow: 0 0 0 3px rgba(74,144,226,.10); background: #fff; }
.login-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 22px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.login-note::before { content: "✓"; display: grid; flex: 0 0 22px; height: 22px; place-items: center; border-radius: 50%; background: #e9f8ef; color: #16834b; font-weight: 800; }

/* Signed-in application */
.shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); gap: 18px; padding: 18px; }
.sidebar {
  position: sticky;
  top: 18px;
  height: calc(100vh - 36px);
  padding: 25px 18px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.68);
  border-radius: 24px;
  background: rgba(255,255,255,.64);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px);
}
.sidebar::before { content:""; position:absolute; width:180px; height:180px; left:-80px; top:-90px; border-radius:50%; background:rgba(74,144,226,.13); filter:blur(3px); pointer-events:none; }
.sidebar .brand { position:relative; margin: 4px 12px 38px; }
.sidebar .brand-logo { width: 184px; }
.nav { position:relative; display: grid; gap: 7px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 44px;
  padding: 11px 14px;
  border: 1px solid transparent;
  border-radius: 13px;
  background: transparent;
  color: #64748b;
  text-align: left;
  transition: .18s ease;
}
.nav button:hover { background: rgba(255,255,255,.66); color: var(--ink); }
.nav button.active {
  border-color: rgba(74,144,226,.13);
  background: linear-gradient(135deg, rgba(74,144,226,.12), rgba(99,102,241,.10));
  color: #245b98;
  box-shadow: 0 7px 18px rgba(74,144,226,.08);
}
.nav button.active::before { content: ""; width: 4px; height: 20px; margin-left: -14px; border-radius: 0 4px 4px 0; background: linear-gradient(var(--blue), var(--violet)); }
.sidebar-bottom { position: absolute; left: 18px; right: 18px; bottom: 20px; }
.mini-user { display: flex; align-items: center; gap: 10px; padding: 14px 12px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 13px; }
.avatar { display: grid; flex: 0 0 38px; height: 38px; place-items: center; border-radius: 13px; background: linear-gradient(135deg, #e6f1ff, #eeeefe); color: var(--blue-dark); font-weight: 750; box-shadow: inset 0 0 0 1px rgba(74,144,226,.10); }
.logout { width: 100%; border: 0; border-radius: 10px; background: transparent; color: #758399; padding: 10px 12px; text-align: left; }
.logout:hover { background: rgba(255,255,255,.55); color: var(--blue-dark); }

.content { min-width: 0; padding: clamp(24px, 4vw, 52px); overflow: hidden; }
.topbar { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 32px; }
.topbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.topbar h1 { margin: 0 0 8px; color: #10254a; font-size: clamp(31px,4vw,44px); font-weight: 690; letter-spacing: -.045em; }
.topbar p { margin: 0; color: var(--muted); }
.pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 13px; border: 1px solid #ccebd9; border-radius: 9999px; background: rgba(239,250,243,.78); color: #167746; font-size: 13px; font-weight: 650; backdrop-filter: blur(8px); }
.pill::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #24a765; box-shadow: 0 0 0 4px rgba(36,167,101,.12); }
.grid { display: grid; grid-template-columns: repeat(12,minmax(0,1fr)); gap: 18px; }
.card {
  grid-column: span 4;
  min-width: 0;
  padding: 25px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255,255,255,.85);
  backdrop-filter: blur(18px);
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-1px); box-shadow: 0 16px 38px rgba(32,53,84,.10), inset 0 1px 0 rgba(255,255,255,.88); }
.card.wide { grid-column: span 8; }
.card.full { grid-column: 1/-1; }
.card h2 { margin: 0 0 6px; color: #16263f; font-size: 18px; font-weight: 670; letter-spacing: -.02em; }
.card-sub { margin: 0 0 22px; color: var(--muted); font-size: 14px; line-height: 1.55; }
.stat { margin-top: 24px; color: #15315e; font-size: 34px; font-weight: 720; letter-spacing: -.04em; }
.stat small { display: block; margin-top: 8px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.profile { display: flex; align-items: center; gap: 18px; }
.profile .avatar { width: 58px; height: 58px; flex-basis: 58px; border-radius: 18px; font-size: 20px; }
.profile strong { display: block; font-size: 18px; font-weight: 680; }
.profile span { display: block; margin-top: 5px; color: var(--muted); font-size: 14px; }
.list { display: grid; gap: 10px; }
.list-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.63); }
.list-item strong { display: block; }
.list-item small { display: block; margin-top: 4px; color: var(--muted); }
.tag { padding: 6px 9px; border-radius: 9999px; background: rgba(238,242,247,.86); color: #475467; font-size: 12px; font-weight: 650; white-space: nowrap; }
.tag.active { background: #eaf8f0; color: #167746; }
.empty { padding: 28px; border: 1px dashed rgba(74,144,226,.26); border-radius: 16px; background: rgba(255,255,255,.32); color: var(--muted); text-align: center; line-height: 1.55; }
.plans { display: grid; grid-template-columns: repeat(auto-fit,minmax(230px,1fr)); gap: 14px; }
.plan { padding: 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255,255,255,.66); }
.plan h3 { margin: 0 0 5px; }
.price { margin: 18px 0; color: #15315e; font-size: 28px; font-weight: 720; }
.price small { color: var(--muted); font-size: 13px; font-weight: 500; }
.plan .primary { min-height: 42px; }
.consent { display: flex; align-items: flex-start; gap: 10px; margin: 0 0 20px; padding: 14px 16px; border: 1px solid rgba(74,144,226,.18); border-radius: 14px; background: rgba(239,246,255,.70); color: #3f536f; font-size: 13px; line-height: 1.5; }
.consent input { flex: 0 0 auto; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--blue); }
.inline-action { width: auto; min-height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: 9999px; background: rgba(255,255,255,.72); color: var(--ink); font-size: 12px; font-weight: 650; white-space: nowrap; }
.inline-action:hover { border-color: rgba(74,144,226,.34); color: var(--blue-dark); }
.inline-action.danger { min-height: 34px; }
.card-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.table-wrap { width: 100%; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { padding: 13px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
th { color: var(--muted); font-size: 11px; letter-spacing: .04em; text-transform: uppercase; }
td strong, td small { display: block; }
td small { max-width: 320px; margin-top: 4px; overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.toast { position: fixed; right: 22px; bottom: 22px; z-index: 20; max-width: 390px; padding: 14px 18px; border: 1px solid rgba(255,255,255,.28); border-radius: 14px; background: rgba(17,39,73,.92); color: #fff; box-shadow: 0 18px 45px rgba(17,24,39,.24); backdrop-filter: blur(12px); }
.modal-backdrop { position: fixed; inset: 0; z-index: 10; display: grid; place-items: center; padding: 20px; background: rgba(32,53,84,.30); backdrop-filter: blur(10px); }
.modal { width: min(100%,440px); padding: 27px; border: 1px solid rgba(255,255,255,.76); border-radius: 24px; background: rgba(255,255,255,.90); box-shadow: var(--shadow); backdrop-filter: blur(20px); }
.modal h2 { margin: 0 0 8px; }
.field { display: grid; gap: 7px; margin-top: 16px; color: #344054; font-size: 13px; font-weight: 620; }
.field input, .field select { width: 100%; min-height: 46px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; outline: 0; background: rgba(255,255,255,.74); }
.field input:focus, .field select:focus { border-color: rgba(74,144,226,.54); box-shadow: 0 0 0 3px rgba(74,144,226,.11); background: #fff; }
.field input[readonly] { background: rgba(245,247,250,.76); color: var(--muted); }
.profile-form { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 2px 18px; max-width: 760px; }
.profile-actions { grid-column: 1/-1; margin-top: 20px; }
.profile-actions .primary { width: auto; min-width: 190px; }
.modal-actions { display: flex; gap: 10px; margin-top: 22px; }
.modal-actions button { flex: 1; }
.inline-form { display: flex; flex-wrap: wrap; gap: 10px; }
.inline-form input:first-child { flex: 1 1 300px; }
.inline-form input[type="number"] { width: 130px; }
.secret-code { overflow-wrap: anywhere; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: rgba(245,247,250,.82); font-family: ui-monospace,Consolas,monospace; font-size: 13px; user-select: all; }

@keyframes portalIn { from { opacity: 0; transform: translateY(16px) scale(.985); } to { opacity: 1; transform: none; } }

@media (max-width: 1000px) {
  .login-shell { min-height: auto; grid-template-columns: 1fr; }
  .login-visual { min-height: 480px; }
  .login-hero { padding: 70px 0 50px; }
  .login-panel { min-height: 520px; border-top: 1px solid var(--line); border-left: 0; }
  .card, .card.wide { grid-column: span 6; }
}

@media (max-width: 760px) {
  body::before { background-size: 52px 52px; }
  .login { place-items: start center; padding: 12px; overflow-x: clip; overflow-y: visible; }
  .login-shell { border-radius: 24px; }
  .login-visual { min-height: 0; padding: 28px 24px; }
  .login .brand-logo { width: 180px; }
  .login-hero { padding: 48px 0 26px; }
  .login h1 { font-size: clamp(37px, 10.5vw, 46px); line-height: 1.04; }
  .login-description { margin-top: 18px; font-size: 14px; line-height: 1.6; }
  .product-cloud { display: none; }
  .login-caption { display: none; }
  .login-panel { min-height: 0; padding: 72px 24px 38px; }
  .login-panel > .language-switch { top: 20px; right: 20px; }
  .shell { display: block; padding: 0 0 76px; }
  .sidebar {
    position: fixed;
    z-index: 5;
    inset: auto 8px 8px;
    width: auto;
    height: 66px;
    padding: 7px;
    border-radius: 19px;
    background: rgba(255,255,255,.82);
  }
  .sidebar > .brand, .sidebar-bottom { display: none; }
  .nav { grid-template-columns: repeat(var(--nav-items,4),1fr); gap: 3px; }
  .nav button { justify-content: center; min-height: 50px; padding: 8px 4px; border-radius: 14px; font-size: 11px; text-align: center; }
  .nav button.active::before { display: none; }
  .content { padding: 25px 16px; }
  .topbar { display: block; }
  .topbar-actions { justify-content: flex-start; margin-top: 16px; }
  .pill { margin-top: 0; }
  .card, .card.wide { grid-column: 1/-1; }
  .profile-form { grid-template-columns: 1fr; }
  .toast { right: 12px; bottom: 84px; left: 12px; max-width: none; }
}

@media (max-width: 430px) {
  .product-cloud { gap: 7px; }
  .product-cloud span { padding: 7px 10px; }
  .login-card-mark { margin-bottom: 20px; }
  .login-card h2 { font-size: 28px; }
  .topbar-actions { align-items: flex-start; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
