/* ZERO – Terms and Conditions page (Views/Home/Terms.cshtml). Light + dark via html[data-theme]. */

:root {
  --t-bg: #f6f5fb;
  --t-card: #ffffff;
  --t-card-inner: #f4f2fb;
  --t-text: #1f2033;
  --t-text-2: #3f4157;
  --t-muted: #6b6f85;
  --t-border: #e6e3f1;
  --t-header: rgba(255, 255, 255, 0.86);
  --t-accent: #8b5cf6;
  --t-accent-2: #ec4899;
  --t-grad: linear-gradient(135deg, #a855f7 0%, #ec4899 100%);
  --t-hero: linear-gradient(120deg, #7c3aed 0%, #c026d3 55%, #db2777 100%);
  --t-info-bg: rgba(139, 92, 246, 0.09);
  --t-info-border: rgba(139, 92, 246, 0.35);
  --t-danger-bg: rgba(239, 68, 68, 0.08);
  --t-danger-border: rgba(239, 68, 68, 0.38);
  --t-danger-text: #b91c1c;
  --t-yes: #059669;
  --t-no: #dc2626;
  --t-shadow: 0 8px 28px rgba(31, 32, 51, 0.07);
  color-scheme: light;
}

html[data-theme="dark"] {
  --t-bg: #0a0a0f;
  --t-card: #12121a;
  --t-card-inner: #1a1a25;
  --t-text: #eceaf6;
  --t-text-2: #c9c7d8;
  --t-muted: #9a98ad;
  --t-border: rgba(255, 255, 255, 0.08);
  --t-header: rgba(10, 10, 15, 0.82);
  --t-info-bg: rgba(139, 92, 246, 0.14);
  --t-info-border: rgba(167, 139, 250, 0.4);
  --t-danger-bg: rgba(239, 68, 68, 0.12);
  --t-danger-border: rgba(248, 113, 113, 0.42);
  --t-danger-text: #fca5a5;
  --t-yes: #34d399;
  --t-no: #f87171;
  --t-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body.terms-body {
  margin: 0;
  background: var(--t-bg);
  color: var(--t-text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

svg {
  width: 1em;
  height: 1em;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

a {
  color: var(--t-accent);
}

.terms-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Header ------------------------------------------------------------------ */
.terms-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--t-header);
  border-bottom: 1px solid var(--t-border);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
}

.terms-header__inner {
  max-width: 1160px;
  margin: 0 auto;
  height: 64px;
  padding: 0 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

.terms-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  flex-shrink: 0;
}

.terms-brand__mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--t-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.9rem;
}

.terms-brand__text {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  background: var(--t-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.terms-back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--t-muted);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

.terms-back:hover {
  color: var(--t-accent);
}

.terms-back--mobile {
  display: none;
  margin: 1rem 0 0;
}

.terms-header__actions .zero-lang__btn {
  height: 38px;
  border-radius: 12px;
}

.terms-header__actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.terms-icon-btn:focus-visible,
.terms-signin:focus-visible,
.terms-avatar:focus-visible,
.terms-top:focus-visible,
.terms-toc a:focus-visible,
.terms-toc__summary:focus-visible {
  outline: 2px solid var(--t-accent);
  outline-offset: 2px;
}

.terms-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--t-border);
  background: var(--t-card);
  color: var(--t-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.05rem;
}

.terms-theme-sun {
  display: none;
}

html[data-theme="dark"] .terms-theme-sun {
  display: block;
}

html[data-theme="dark"] .terms-theme-moon {
  display: none;
}

.terms-signin {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 0.95rem;
  border-radius: 12px;
  background: var(--t-grad);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  white-space: nowrap;
}

.terms-avatar {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--t-grad);
  color: #fff;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.terms-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Layout ------------------------------------------------------------------ */
.terms-wrap {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.terms-hero {
  margin-top: 1.5rem;
  border-radius: 24px;
  padding: 2.25rem 2.25rem 2rem;
  background: var(--t-hero);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(124, 58, 237, 0.25);
}

.terms-hero::after {
  content: "";
  position: absolute;
  width: 320px;
  height: 320px;
  right: -90px;
  top: -140px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.22) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.terms-hero__title {
  margin: 0;
  font-size: clamp(1.75rem, 4vw, 2.6rem);
  font-weight: 900;
  line-height: 1.15;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.terms-hero__pills {
  margin-top: 1.1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.terms-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.18);
  font-size: 0.8rem;
  font-weight: 600;
}

.terms-layout {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: 250px minmax(0, 760px);
  gap: 2rem;
  justify-content: center;
  align-items: start;
}

/* Contents ---------------------------------------------------------------- */
.terms-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
}

.terms-toc__box {
  border: 1px solid var(--t-border);
  border-radius: 18px;
  background: var(--t-card);
  padding: 0.5rem;
}

.terms-toc__summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--t-muted);
  cursor: pointer;
  border-radius: 12px;
}

.terms-toc__summary::-webkit-details-marker {
  display: none;
}

.terms-toc__chevron {
  margin-left: auto;
  transition: transform 0.2s ease;
}

.terms-toc__box[open] .terms-toc__chevron {
  transform: rotate(180deg);
}

.terms-toc__list {
  list-style: none;
  margin: 0;
  padding: 0.15rem 0 0.25rem;
}

.terms-toc__list a {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.5rem 0.65rem;
  border-radius: 12px;
  color: var(--t-text-2);
  text-decoration: none;
  font-size: 0.86rem;
  line-height: 1.4;
}

.terms-toc__list a:hover {
  background: var(--t-card-inner);
}

.terms-toc__list a.is-active {
  background: var(--t-info-bg);
  color: var(--t-text);
  font-weight: 700;
}

.terms-toc__num {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: var(--t-card-inner);
  color: var(--t-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
}

.terms-toc__list a.is-active .terms-toc__num {
  background: var(--t-grad);
  color: #fff;
}

/* Section cards ----------------------------------------------------------- */
.terms-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.terms-card {
  scroll-margin-top: 84px;
  border: 1px solid var(--t-border);
  border-radius: 22px;
  background: var(--t-card);
  box-shadow: var(--t-shadow);
  padding: 1.6rem 1.75rem 1.4rem;
}

.terms-card__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.9rem;
}

.terms-card__badge {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--t-grad);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 0.95rem;
  box-shadow: 0 6px 16px rgba(168, 85, 247, 0.3);
}

.terms-card__icon {
  font-size: 1.2rem;
  color: var(--t-accent);
}

.terms-card__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.35;
  letter-spacing: -0.01em;
  min-width: 0;
  overflow-wrap: anywhere;
}

.terms-card__body {
  color: var(--t-text-2);
  overflow-wrap: anywhere;
}

.terms-card__body p {
  margin: 0 0 0.85rem;
}

.terms-card__body > :last-child,
.terms-card__body > :last-child > :last-child {
  margin-bottom: 0;
}

.terms-h3 {
  margin: 1.2rem 0 0.5rem;
  font-size: 1.02rem;
  font-weight: 800;
  color: var(--t-text);
}

.terms-list {
  margin: 0 0 0.95rem;
  padding-left: 1.25rem;
}

.terms-list li {
  margin-bottom: 0.35rem;
}

.terms-list li::marker {
  color: var(--t-accent);
}

/* Callouts */
.terms-callout {
  border-radius: 16px;
  padding: 0.95rem 1.1rem;
  margin: 0 0 1rem;
  border: 1px solid;
}

.terms-callout--info {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  background: var(--t-info-bg);
  border-color: var(--t-info-border);
  color: var(--t-text);
  font-weight: 600;
}

.terms-callout--info svg {
  font-size: 1.2rem;
  margin-top: 0.2rem;
  color: var(--t-accent);
}

.terms-callout--danger {
  background: var(--t-danger-bg);
  border-color: var(--t-danger-border);
}

.terms-callout--danger .terms-callout__title {
  color: var(--t-danger-text);
  font-weight: 800;
  margin-bottom: 0.4rem;
}

.terms-callout--danger .terms-list {
  margin-bottom: 0;
}

.terms-callout--danger .terms-list li::marker {
  color: var(--t-no);
}

/* Section 6: three warnings visual */
.terms-warnings {
  list-style: none;
  margin: 0 0 1.1rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.6rem;
  counter-reset: none;
}

.terms-warnings__step {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.35rem;
  padding: 0.8rem 0.4rem 0.7rem;
  border-radius: 16px;
  background: var(--t-card-inner);
  border: 1px solid var(--t-border);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--t-text);
}

.terms-warnings__num {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: #f59e0b;
}

.terms-warnings__step:nth-child(2) .terms-warnings__num {
  background: #f97316;
}

.terms-warnings__step:nth-child(3) .terms-warnings__num {
  background: #ef4444;
}

.terms-warnings__step--ban {
  background: var(--t-danger-bg);
  border-color: var(--t-danger-border);
  color: var(--t-danger-text);
}

.terms-warnings__step--ban .terms-warnings__num {
  background: #991b1b;
}

/* Section 7: numbered auction steps */
.terms-steps {
  list-style: none;
  counter-reset: terms-step;
  margin: 0.25rem 0 1rem;
  padding: 0;
}

.terms-steps li {
  counter-increment: terms-step;
  position: relative;
  padding: 0 0 0.9rem 2.75rem;
  min-height: 2rem;
}

.terms-steps li::before {
  content: counter(terms-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: var(--t-grad);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.terms-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 14px;
  top: 32px;
  bottom: 2px;
  width: 2px;
  background: var(--t-border);
}

.terms-steps li span {
  display: block;
  padding-top: 0.15rem;
}

/* Section 8: coin cards */
.terms-coins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  margin-top: 0.4rem;
}

.terms-coin-card {
  border-radius: 18px;
  padding: 1.05rem 1.1rem 0.95rem;
  background: var(--t-card-inner);
  border: 1px solid var(--t-border);
  min-width: 0;
}

.terms-coin-card__head {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.65rem;
}

.terms-coin-card__letter {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  color: #fff;
  background: linear-gradient(135deg, #f59e0b, #f97316);
  flex-shrink: 0;
}

.terms-coin-card--b .terms-coin-card__letter {
  background: var(--t-grad);
}

.terms-coin-card__title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  color: var(--t-text);
}

.terms-coin-card p {
  font-size: 0.93rem;
}

.terms-mark-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.terms-mark-row {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.45rem 0;
  border-top: 1px solid var(--t-border);
  font-size: 0.92rem;
  line-height: 1.55;
}

.terms-mark {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 900;
  margin-top: 0.1rem;
}

.is-yes .terms-mark {
  color: var(--t-yes);
  background: color-mix(in srgb, var(--t-yes) 15%, transparent);
}

.is-no .terms-mark {
  color: var(--t-no);
  background: color-mix(in srgb, var(--t-no) 15%, transparent);
}

/* Back to top */
.terms-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 0;
  background: var(--t-grad);
  color: #fff;
  font-size: 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.35);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 30;
}

.terms-top.is-visible {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* Responsive -------------------------------------------------------------- */
@media (max-width: 1023px) {
  .terms-layout {
    grid-template-columns: minmax(0, 760px);
    gap: 1rem;
  }

  .terms-toc {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 699px) {
  .terms-back--header {
    display: none;
  }

  .terms-back--mobile {
    display: inline-flex;
  }

  .terms-header__inner {
    height: 58px;
    padding: 0 1rem;
    gap: 0.5rem;
  }

  .terms-header__actions {
    gap: 0.4rem;
  }

  .terms-brand__mark {
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }

  .terms-brand__text {
    font-size: 1.05rem;
  }

  .terms-signin {
    padding: 0 0.75rem;
  }

  .terms-wrap {
    padding: 0 1rem 3.5rem;
  }

  .terms-hero {
    margin-top: 0.75rem;
    border-radius: 20px;
    padding: 1.5rem 1.25rem 1.35rem;
  }

  .terms-card {
    padding: 1.2rem 1.1rem 1.1rem;
    border-radius: 18px;
  }

  .terms-card__title {
    font-size: 1.08rem;
  }

  .terms-warnings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .terms-coins {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 359px) {
  .terms-brand__text {
    display: none;
  }
}

/* Print ------------------------------------------------------------------- */
@media print {
  :root,
  html[data-theme="dark"] {
    --t-bg: #fff;
    --t-card: #fff;
    --t-card-inner: #fff;
    --t-text: #000;
    --t-text-2: #111;
    --t-muted: #333;
    --t-border: #ccc;
    --t-shadow: none;
    color-scheme: light;
  }

  .terms-header,
  .terms-back,
  .terms-toc,
  .terms-top {
    display: none !important;
  }

  body.terms-body {
    font-size: 11pt;
    line-height: 1.5;
  }

  .terms-wrap {
    max-width: none;
    padding: 0;
  }

  .terms-hero {
    background: none;
    color: #000;
    box-shadow: none;
    padding: 0 0 12pt;
    border-radius: 0;
    border-bottom: 2px solid #000;
  }

  .terms-pill {
    background: none;
    border: 1px solid #999;
    color: #000;
  }

  .terms-layout {
    display: block;
    margin-top: 12pt;
  }

  .terms-card {
    box-shadow: none;
    border: 0;
    border-radius: 0;
    padding: 0 0 10pt;
    break-inside: avoid-page;
  }

  .terms-card__badge,
  .terms-warnings__num,
  .terms-steps li::before,
  .terms-coin-card__letter {
    background: none !important;
    color: #000 !important;
    border: 1px solid #000;
    box-shadow: none;
  }

  .terms-coins {
    grid-template-columns: 1fr 1fr;
  }

  a {
    color: #000;
    text-decoration: none;
  }
}
