:root {
  --ink: #1b1848;
  --muted: #8b90a5;
  --label: #b7bdd2;
  --line: #e4e7f6;
  --blue: #2f5bff;
  --blue-dark: #2348e0;
  --bg: #eef0f6;
  --card: #ffffff;
  --danger: #d3274b;
  --shadow: 0 18px 50px rgba(28, 32, 68, 0.12);
  font-family: Inter, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
  color: var(--ink);
  background: var(--bg);
}

button, input { font: inherit; }

button { cursor: pointer; }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background:
    radial-gradient(720px 320px at 50% 0%, rgba(47, 91, 255, 0.16), transparent 70%),
    var(--bg);
}

.modal-backdrop {
  width: min(440px, 100%);
}

.modal {
  background: var(--card);
  border-radius: 28px;
  box-shadow: 0 24px 60px rgba(27, 24, 72, 0.14);
  padding: 22px 26px 20px;
  max-height: calc(100vh - 48px);
  overflow: auto;
}

.modal-brand {
  display: flex;
  justify-content: center;
  margin-bottom: 6px;
}

.modal-brand img {
  width: 148px;
  height: auto;
}

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.modal-head h2,
.gate h1,
.hero h1,
.category-hero h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -0.03em;
}

.modal-close {
  width: 32px;
  height: 32px;
  margin: -4px -6px 0 0;
  border: 0;
  background: transparent;
  color: #9aa1b8;
  font-size: 26px;
  line-height: 1;
  font-weight: 400;
}

.lead,
.hero p,
.category-hero p,
.gate p {
  margin: 10px 0 0;
  color: #8d93aa;
  font-size: 15px;
  line-height: 1.45;
  font-weight: 400;
}

.field-label {
  display: block;
  margin: 26px 0 8px;
  color: var(--label);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.field-label span {
  margin-left: 6px;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 500;
  color: #c5cadb;
}

input[type="email"],
input[type="tel"],
input[type="text"],
input[type="password"],
#full-name,
#company,
#city,
#tax-no,
#email,
#phone,
#login-password {
  width: 100%;
  height: 54px;
  border: 1.5px solid #e3e6f5;
  border-radius: 14px;
  padding: 0 16px;
  color: var(--ink);
  background: #fff;
  outline: none;
}

input::placeholder { color: #b7bccb; }

input:focus {
  border-color: #c9d2ff;
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.12);
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.35;
}

.form-error:not(:empty) {
  margin: 8px 2px 0;
}

.btn-primary {
  width: 100%;
  height: 54px;
  margin-top: 16px;
  border: 0;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

.btn-primary:hover { background: var(--blue-dark); }

.btn-primary:disabled {
  opacity: 0.7;
  cursor: progress;
}

.mail-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  margin-top: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f6ff;
  color: #2a46c9;
  font-size: 13px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.password-field {
  position: relative;
}

.password-field input {
  padding-right: 52px;
}

.toggle-password {
  position: absolute;
  top: 7px;
  right: 8px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #8b90a5;
  display: grid;
  place-items: center;
}

.toggle-password:hover { color: var(--blue); background: #f4f6ff; }

.modal-links {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eef0f8;
}

.modal-links button {
  flex: 1;
  min-height: 40px;
  border: 0;
  border-radius: 12px;
  background: #f5f6fb;
  color: #3c446c;
  font-size: 13px;
  font-weight: 650;
  padding: 8px 10px;
}

.modal-links button:hover { background: #eef1ff; color: var(--blue); }

.back-link,
.btn-quiet {
  border: 0;
  background: transparent;
  color: #5d68d6;
  font-size: 13px;
  font-weight: 600;
  padding: 0;
}

.code-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

.code-digit {
  width: 100%;
  height: 56px;
  border: 1.5px solid #e3e6f5;
  border-radius: 12px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  outline: none;
}

.code-digit:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.12);
}

.gate {
  width: min(420px, 100%);
  text-align: center;
}

.gate-mark,
.brand-mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 0 auto 14px;
  border-radius: 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.gate-btn {
  max-width: 240px;
  margin: 22px auto 0;
}

#market { min-height: 100vh; background: #f6f7fb; }

.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 74px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid #e8ebf4;
  backdrop-filter: blur(12px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  margin: 0;
  border-radius: 11px;
  font-size: 13px;
}

.brand-text {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-text em {
  font-style: normal;
  color: var(--blue);
}

.topbar-user {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  line-height: 1.2;
  max-width: 220px;
  border: 0;
  border-radius: 14px;
  padding: 8px 12px;
  background: #f3f6ff;
  color: inherit;
  text-align: right;
}

.user-chip:hover { background: #e7edff; }

.user-chip strong,
.user-chip span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong { font-size: 14px; }

.user-chip span {
  color: var(--muted);
  font-size: 12px;
}

.btn-quiet {
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  background: #eef1ff;
}

main {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 36px 0 64px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.12em;
}

.hero h1,
.category-hero h1 {
  font-size: 40px;
  letter-spacing: -0.045em;
}

.hero p,
.category-hero p {
  max-width: 560px;
  font-size: 17px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-top: 28px;
}

.category-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  min-height: 188px;
  padding: 18px;
  border: 1px solid #e7eaf3;
  border-radius: 18px;
  background: #fff;
  color: inherit;
  text-align: left;
  box-shadow: 0 8px 24px rgba(28, 32, 68, 0.04);
}

.category-card:hover {
  border-color: #cfd7ff;
  transform: translateY(-2px);
}

.category-card strong {
  font-size: 16px;
  letter-spacing: -0.02em;
}

.category-card span {
  color: #71788d;
  font-size: 13px;
  line-height: 1.4;
}

.icon-bubble {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
}

.icon-bubble svg { width: 24px; height: 24px; }

.back-link { margin-bottom: 18px; font-size: 14px; }

.category-hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.category-icon .icon-bubble {
  width: 64px;
  height: 64px;
  border-radius: 18px;
}

.category-icon svg { width: 30px; height: 30px; }

.service-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 26px;
}

.service-card {
  padding: 18px 18px 16px;
  border: 1px solid #e7eaf3;
  border-radius: 16px;
  background: #fff;
}

.service-card h2 {
  margin: 0 0 6px;
  font-size: 16px;
}

.service-card p {
  margin: 0;
  color: #71788d;
  font-size: 14px;
  line-height: 1.45;
}

.service-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.price {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.price small {
  font-weight: 600;
  color: #71788d;
}

.order-btn {
  border: 0;
  background: #eef1ff;
  color: var(--blue);
  font-weight: 700;
  border-radius: 999px;
  height: 36px;
  padding: 0 14px;
}

.order-layer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: rgba(22, 24, 48, 0.38);
}

.order-modal { width: min(440px, 100%); }

textarea {
  width: 100%;
  border: 1.5px solid #e3e6f5;
  border-radius: 14px;
  padding: 12px 16px;
  min-height: 96px;
  resize: vertical;
  color: var(--ink);
  outline: none;
}

textarea:focus {
  border-color: #c9d2ff;
  box-shadow: 0 0 0 4px rgba(47, 91, 255, 0.12);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 40;
  margin: 0;
  padding: 12px 16px;
  border-radius: 999px;
  background: #1b1848;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}

body.market-open { background: #f6f7fb; }

.support-launcher,
.support-panel { display: none; }

body.market-open .support-launcher {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 25;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border: 0;
  border-radius: 50%;
  background: #2f5bff;
  color: #fff;
  box-shadow: 0 12px 28px rgba(47, 91, 255, 0.35);
}

.support-badge {
  position: absolute;
  top: -2px;
  right: -2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: #d3274b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
}

body.market-open .support-panel {
  position: fixed;
  right: 22px;
  bottom: 92px;
  z-index: 26;
  display: flex;
  flex-direction: column;
  width: min(380px, calc(100vw - 24px));
  height: min(560px, calc(100vh - 120px));
  background: #fff;
  border-radius: 22px;
  box-shadow: 0 24px 60px rgba(27, 24, 72, 0.2);
  overflow: hidden;
}

.support-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #eef0f6;
}

.support-head h2 { margin: 0; font-size: 18px; letter-spacing: -0.03em; }
.support-head p { margin: 4px 0 0; color: #8b90a5; font-size: 13px; line-height: 1.35; }

.support-close {
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #9aa1b8;
  font-size: 26px;
  line-height: 1;
}

.support-log {
  flex: 1;
  overflow: auto;
  padding: 18px 16px;
  background: #fff;
}

.support-hello {
  margin: 28px 12px;
  color: #8b90a5;
  text-align: center;
  line-height: 1.5;
}

.support-msg { display: flex; flex-direction: column; align-items: flex-start; margin-bottom: 10px; }
.support-msg p {
  margin: 0;
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  background: #f4f6fb;
  color: #1b1848;
  line-height: 1.4;
}
.support-msg time { margin-top: 4px; color: #a0a6ba; font-size: 11px; }
.support-msg.mine { align-items: flex-end; }
.support-msg.mine p { background: #2f5bff; color: #fff; }

.support-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid #eef0f6;
}

.support-form input { height: 46px; margin: 0; }
.support-form button {
  height: 46px;
  margin: 0;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: #2f5bff;
  color: #fff;
  font-weight: 700;
}
.support-form button:disabled { opacity: 0.7; }
.support-error { grid-column: 1 / -1; margin: 0; color: #d3274b; font-size: 13px; }
.support-error:empty { display: none; }

@media (max-width: 980px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 680px) {
  .topbar { height: auto; padding: 14px 16px; align-items: flex-start; }
  .user-chip { max-width: 42vw; }
  main { width: min(100% - 28px, 1120px); }
  .hero h1, .category-hero h1 { font-size: 32px; }
  .category-grid, .service-list { grid-template-columns: 1fr; }
  .modal { padding: 22px 18px 18px; }
}
