/* Thành phần của web thật không có trong prototype. Chỉ dùng token của tokens.css. */

.estimate {
  margin-top: var(--sp-5);
  max-width: 34rem;
}

.estimate__card {
  display: grid;
  gap: var(--sp-3);
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
}

.estimate__name {
  font-size: var(--text-lg);
  line-height: 1.35;
}

.estimate__meta,
.estimate__hint {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.estimate__none {
  padding: var(--sp-3);
  background: var(--paper-2);
  border-radius: var(--radius-inner);
  font-size: var(--text-sm);
}

.estimate__error {
  color: var(--void);
  font-size: var(--text-sm);
}

/* Màn cổng: đồng ý dữ liệu. Thẻ hai cột theo mẫu Semrush trên Mobbin: bên trái ai đang đăng nhập
   và lời hứa, bên phải ba thứ bên mình giữ cùng nút đồng ý. Màn hẹp xếp chồng một cột. */
.gate-page {
  background: var(--paper);
}

.gate {
  display: grid;
  place-items: center;
  min-height: calc(100dvh - 72px);
  padding: var(--sp-section) var(--sp-4);
}

.gate__card {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  width: min(100%, 56rem);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  animation: gate-in 420ms var(--ease-out-expo) both;
}

.gate__intro {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--sp-6);
  padding: var(--sp-8) var(--sp-6);
  background: var(--brand-soft);
}

.gate__body {
  display: grid;
  align-content: start;
  gap: var(--sp-5);
  padding: var(--sp-8) var(--sp-6);
}

.gate__who {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  justify-self: start;
  max-width: 100%;
  padding: var(--sp-1) var(--sp-3) var(--sp-1) var(--sp-1);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: var(--text-sm);
}

.gate__who[hidden] {
  display: none;
}

.gate__avatar {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--surface);
  font-size: var(--text-micro);
  font-weight: 700;
}

.gate__switch {
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.gate__switch:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.gate__email {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gate__head {
  display: grid;
  align-content: start;
  gap: var(--sp-3);
}

.gate__head h1 {
  font-size: var(--text-3xl);
  line-height: 1.15;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.gate__lead {
  color: var(--ink-2);
  max-width: 32ch;
}

.gate__note {
  padding-top: var(--sp-4);
  border-top: 1px solid oklch(52% 0.185 250 / 0.18);
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.gate__note a {
  display: inline-block;
  margin-top: var(--sp-1);
  color: var(--brand);
  font-weight: 600;
  text-underline-offset: 3px;
}

.gate__actions {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-2);
}

.gate__error {
  padding: var(--sp-3);
  border-radius: var(--radius-inner);
  background: var(--void-soft);
  color: var(--void);
  font-size: var(--text-sm);
}

.gate__error[hidden] {
  display: none;
}

.consent-list {
  display: grid;
  gap: var(--sp-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.consent-list li {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: var(--sp-3);
  row-gap: 2px;
}

.consent-list svg {
  grid-row: span 2;
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: var(--radius);
  background: var(--brand-soft);
  fill: var(--brand);
}

.consent-list strong {
  padding-top: 1px;
}

.consent-list span {
  color: var(--ink-2);
  font-size: var(--text-sm);
}

@keyframes gate-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gate__card {
    animation: none;
  }
}

@media (max-width: 760px) {
  .gate {
    place-items: start stretch;
    min-height: 0;
    padding: var(--sp-4);
  }

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

  .gate__intro,
  .gate__body {
    padding: var(--sp-5) var(--sp-4);
  }

  .gate__intro {
    gap: var(--sp-4);
  }

  .gate__head h1 {
    font-size: var(--text-2xl);
  }
}

.estimate__notice {
  padding: var(--sp-3);
  background: var(--brand-soft);
  border-radius: var(--radius-inner);
  font-size: var(--text-sm);
}

/* Hộp tiền hoàn ước tính, lấy từ prototype/shop.css. Màu hổ phách vì đây là số ước tính. */
.cashback-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--pending-soft);
}

.cashback-box .money {
  font-size: var(--text-3xl);
  line-height: 1;
}

.cashback-box > p {
  max-width: 16ch;
  font-size: var(--text-sm);
  color: var(--ink-2);
  text-align: right;
}

/* Màn rất hẹp: dòng gợi ý xuống dưới số tiền thay vì gãy năm dòng bên cạnh. */
@media (max-width: 400px) {
  .cashback-box {
    flex-wrap: wrap;
  }

  .cashback-box > p {
    max-width: none;
    text-align: left;
  }
}

/* Ba bước ngang, lấy từ "Cashback timeline" của ShopBack qua prototype/shop.css. */
.buy-steps {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.buy-steps::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 16%;
  right: 16%;
  border-top: 1px dashed var(--line-strong);
}

.buy-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
}

.buy-steps li::before {
  content: "";
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--surface);
}

.buy-steps strong {
  color: var(--ink);
  font-size: var(--text-sm);
  font-weight: 600;
}

.estimate__card > .btn {
  width: 100%;
  min-height: 48px;
}

/* Hộp thoại sang Shopee, lấy từ prototype/web-shop.css. */
.handoff {
  width: min(460px, calc(100% - 2 * var(--sp-4)));
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  border: none;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lift);
  text-align: center;
}

.handoff[open] {
  display: grid;
  gap: var(--sp-3);
  justify-items: center;
}

.handoff::backdrop {
  background: var(--scrim);
}

/* Hộp thoại trồi lên ngay sau cú bấm mua, để người dùng biết cú bấm đã được ghi nhận. */
@media (prefers-reduced-motion: no-preference) {
  .handoff[open] {
    animation: handoff-in var(--duration-normal) var(--ease-out-expo);
  }

  .handoff[open]::backdrop {
    animation: handoff-fade var(--duration-normal) linear;
  }
}

@keyframes handoff-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.98);
  }
}

@keyframes handoff-fade {
  from {
    opacity: 0;
  }
}

.handoff h2 {
  font-size: var(--text-2xl);
}

.handoff p {
  max-width: 36ch;
  color: var(--ink-2);
  font-size: var(--text-sm);
}

.handoff .warn {
  width: 100%;
  text-align: left;
}

.handoff .btn,
.handoff form {
  width: 100%;
}

.handoff__close {
  width: 100%;
}

.hero__demo {
  display: grid;
  gap: var(--sp-3);
  width: min(100%, 26rem);
  margin-inline: auto;
}

/* Trên màn cảm ứng, mọi thứ bấm được đạt 44px (luật 9 của tokens.css). Trên màn chuột nút thấp
   hơn một chút. */
@media (pointer: coarse) {
  .btn,
  .hero__form .btn {
    min-height: var(--touch);
  }
}

/* Màn đăng nhập chia đôi: cột nút trên nền trắng, cột hình trên nền xanh nhạt. Màn hẹp: hình lên trên. */
.login-page {
  background: var(--surface);
}

.login {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  min-height: 100dvh;
}

.login__form {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--sp-6);
  padding: var(--sp-6) clamp(var(--sp-5), 5vw, var(--sp-8) * 1.5);
}

.login__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  justify-self: start;
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
}

/* Logo trên nền trắng: thêm viền mảnh để ô trắng của logo không tan vào nền trang. */
.login__brand .wordmark__mark {
  box-shadow: 0 0 0 1px var(--line);
}

.login__main {
  display: grid;
  align-content: center;
  gap: var(--sp-4);
  width: min(100%, 26rem);
}

.login__main--wide {
  width: min(100%, 32rem);
}

.login__main h1 {
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.login__lead {
  margin-bottom: var(--sp-3);
  font-size: var(--text-lg);
  color: var(--ink-2);
}

.login-options {
  display: grid;
  gap: var(--sp-3);
}

.login-option {
  width: 100%;
  min-height: 52px;
  gap: var(--sp-3);
  font-size: var(--text-lg);
  box-shadow: var(--shadow-raise);
}

.login__note {
  font-size: var(--text-sm);
  color: var(--ink-2);
}

.login__note a {
  color: var(--ink);
  text-underline-offset: 3px;
}

.login__foot {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  font-size: var(--text-sm);
}

.login__foot a {
  color: var(--ink-2);
}

.login__visual {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: var(--sp-3);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(40rem 28rem at 50% 45%, var(--surface), transparent 70%),
    var(--brand-soft);
}

/* Ảnh nền trắng, multiply để nền trắng hoà vào nền xanh nhạt. */
.login__visual img {
  width: min(88%, 720px);
  height: auto;
  mix-blend-mode: multiply;
}

.login__slogan {
  position: absolute;
  left: clamp(var(--sp-5), 4vw, var(--sp-8));
  bottom: clamp(var(--sp-5), 4vw, var(--sp-8));
  max-width: 14ch;
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 1rem + 2vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--brand);
}

@media (prefers-reduced-motion: no-preference) {
  .login__main {
    animation: gate-in 420ms var(--ease-out-expo) both;
  }

  .login__visual img {
    animation: gate-in 700ms var(--ease-out-expo) 120ms both;
  }
}

@media (max-width: 860px) {
  .login {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    min-height: 100dvh;
  }

  .login__visual {
    order: -1;
    height: 30dvh;
    min-height: 200px;
    margin: var(--sp-3) var(--sp-3) 0;
  }

  .login__visual img {
    width: auto;
    height: calc(30dvh - var(--sp-4));
    min-height: 184px;
  }

  .login__slogan {
    display: none;
  }

  /* Màn đồng ý và Mở web nhiều chữ: màn hẹp bỏ hình để nút bấm không bị đẩy xa. */
  .login__visual--wide-only {
    display: none;
  }

  .login__form {
    padding: var(--sp-6) var(--sp-5);
  }

  .login__main {
    align-content: start;
  }
}

/* Lỗi dán link (#109): nói sai gì, chỉ dạng link đúng, nút Dán lại. Nền trắng vì có thể nằm trên
   dải xanh của trang chủ. */
.paste-error {
  display: grid;
  gap: var(--sp-2);
  justify-items: start;
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
}

.paste-error__message {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--void);
}
