/* ATB168 landing page — Figma "atb2" (home/login, 440px mobile column on a desktop backdrop)
   ระยะแนวนอนเป็น % ของคอลัมน์ (อิง 440px) เพื่อให้ย่อบนจอแคบได้ */

:root {
  --color-surface: #0d0903;
  --color-text: #ffffff;
  --color-text-muted: #bcb8a7;
  --color-placeholder: #827c68;

  --color-gold-100: #fff08c;
  --color-gold-200: #e8d781;
  --color-gold-700: #b78515;
  --color-bronze: #764a1b;

  --color-red-dark: #500000;
  --color-red: #ff0000;

  --color-field: #0f0a00;
  --color-button-dark: #050603;
  --color-tile: #1b1b1b;

  --color-line: #56b527;
  --color-telegram: #39a2ff;

  --gradient-gold: linear-gradient(90deg, var(--color-gold-700), var(--color-gold-100));

  --column: 440px;
  --bar-height: 65px;
}

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

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

body {
  margin: 0;
  background-color: var(--color-surface);
  color: var(--color-text);
  font-family: "Prompt", "Noto Sans Thai", ui-sans-serif, system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, p, ul { margin: 0; padding: 0; }
ul { list-style: none; }
button, input { font: inherit; color: inherit; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

:focus-visible { outline: 2px solid var(--color-gold-100); outline-offset: 2px; }

/* ---------- Page column ---------- */

.page {
  position: relative;
  max-width: var(--column);
  min-height: 100vh;
  margin-inline: auto;
  overflow: hidden;
  text-align: center;
}

.section { position: relative; isolation: isolate; }

/* พื้นหลังคลื่นแดง-ทอง: รูป 1441px กลับหัว เลื่อนซ้าย 501px + blur และ overlay ดำ 20% ตาม Figma */
.bg-waves {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.bg-waves img {
  position: absolute;
  top: 0;
  left: -113.86%;
  width: 327.5%;
  max-width: none;
  margin-top: var(--offset);
  transform: rotate(180deg);
  filter: blur(10px) brightness(0.8);
}
.section--top .bg-waves { --offset: -67.95%; }
.section--bottom .bg-waves { --offset: -166.82%; }

/* ---------- Top: logo, banner, login ---------- */

.section--top { padding: 16px 0 calc(81px + 24.77%); }

.logo { width: 30.23%; margin-inline: auto; }

.banner {
  width: 87.73%;
  margin: 9px auto 0;
  border-radius: 29px;
}

.login {
  display: grid;
  gap: 20px;
  width: 89.09%;
  margin: 20px auto 0;
}

.field { position: relative; }
.field input {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--color-bronze);
  border-radius: 8px;
  background: var(--color-field);
  font-size: 16px;
  color: var(--color-text);
}
.field input::placeholder { color: var(--color-placeholder); opacity: 1; }
.field input:focus { border-color: var(--color-gold-200); outline: none; }
.field--password input { padding-right: 48px; }

.field__toggle {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 44px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}
.field__toggle[aria-pressed="true"] { opacity: 0.55; }

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  font-size: 16px;
  color: var(--color-text);
  cursor: pointer;
}
.button--gold {
  background: var(--gradient-gold);
  box-shadow: inset 0 -4px 6px 0 rgb(0 0 0 / 0.25);
}
.button--outline {
  border: 1px solid var(--color-gold-200);
  background: var(--color-button-dark);
}

.note {
  margin-top: 20px;
  font-size: 12px;
  color: var(--color-text-muted);
}
.note a { font-weight: 700; color: var(--color-text); }

/* ---------- Content blocks ---------- */

.poster { width: 91.59%; margin: 30px auto 0; }

.heading {
  margin-top: 48px;
  padding-inline: 16px;
  font-size: min(24px, 5.45vw); /* 24px ที่ 440px ย่อตามจอแคบ */
  font-weight: 700;
  line-height: 1.5;
}
.heading--tight { margin-top: 18px; }

.copy {
  max-width: 90.91%;
  margin: 12px auto 0;
  font-size: 14px;
  text-wrap: pretty;
}
/* มือถือ 440px ขึ้นไปตัดบรรทัดตาม Figma — จอแคบกว่าและ desktop ปล่อยให้ตัดคำเอง */
@media (min-width: 440px) and (max-width: 767.98px) {
  .copy span { display: block; white-space: nowrap; }
}

.cta { display: block; width: 90.45%; margin: 55px auto 0; }
.cta--compact { margin-top: 39px; }
.cta img { width: 100%; }

/* ---------- Providers ---------- */

.section--providers { padding-bottom: 32px; }

.section--providers .bg-casino {
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}
.section--providers .bg-casino img {
  position: absolute;
  top: 0;
  left: -18.64%;
  width: 139.55%;
  max-width: none;
  height: 100%;
  object-fit: cover;
  transform: rotate(180deg);
}

/* หัวข้อ "ค่ายเกมส์ดัง" คร่อมรอยต่อ section ตาม design */
.providers-heading {
  width: 94.32%;
  margin: 0 auto;
  margin-top: -24.77%;
  transform: translateX(0.11%);
}
.providers-heading img { width: 100%; }

.providers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 17px 16px;
  margin-top: 17px;
  padding-inline: 3.44%;
}
.providers li {
  position: relative;
  aspect-ratio: 1;
  border: 4px solid var(--color-bronze);
  border-radius: 25px;
  background: var(--color-tile);
}
/* ขนาดโลโก้ใน Figma ไม่เท่ากันทุกค่าย: s 75px / m 79px / l 86px / xl 91px บนกรอบ 91px */
.providers img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--logo, 90.3%);
  max-width: none;
  transform: translate(-50%, -50%);
}
.providers .logo-m { --logo: 95.4%; }
.providers .logo-l { --logo: 103.2%; }
.providers .logo-xl { --logo: 109.6%; }

/* ---------- Bottom: auto deposit, jackpot, steps ---------- */

/* padding ล่าง 75px = เว้นที่ให้แถบปุ่มล่างจอ */
.section--bottom { padding: 19px 0 75px; }

.auto-deposit { width: 78.86%; margin-inline: auto; }
.steps { width: 92.27%; margin: 39px auto 0; }

/* ---------- Footer ---------- */

.footer { margin-top: 39px; font-size: 14px; }
.footer__logo { width: 25.91%; margin: 3px auto 5px; }
.footer__copyright { margin-top: 21px; }

/* ---------- Fixed: bottom bar + contact buttons ---------- */

.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  z-index: 30;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 100%;
  max-width: var(--column);
  height: var(--bar-height);
  overflow: hidden;
  border-radius: 10px 10px 0 0;
  transform: translateX(-50%);
  font-size: 20px;
}
.bottom-bar a { display: flex; align-items: center; justify-content: center; }
.bottom-bar__login { background: var(--gradient-gold); color: #000; }
/* gradient แดงใน Figma ไล่ตลอดความกว้าง 440px — ครึ่งขวาจึงเริ่มจากกึ่งกลางของ gradient */
.bottom-bar__register {
  background: linear-gradient(90deg, var(--color-red-dark) -100%, var(--color-red) 100%);
  color: var(--color-text);
}

.contact-dock {
  position: fixed;
  right: 0;
  bottom: calc(var(--bar-height) + 50px);
  left: 0;
  z-index: 30;
  max-width: var(--column);
  margin-inline: auto;
  pointer-events: none;
}
.contact {
  display: grid;
  gap: 8.4px;
  width: 69.4px;
  margin-left: auto;
  margin-right: 13.5px;
  padding: 7.2px 8.4px;
  border-radius: 13px;
  background: rgb(0 0 0 / 0.7);
  box-shadow: 0 0 8px 0 rgb(0 0 0 / 0.25);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  pointer-events: auto;
}
.contact a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52.6px;
  height: 52.6px;
  border-radius: 10px;
}
.contact__line { background: var(--color-line); }
.contact__telegram { background: var(--color-telegram); }

/* ---------- Desktop (≥ 768px) ----------
   Figma มีแค่คอลัมน์ 440px บนพื้นหลังเต็มจอ — ขยายเป็นคอลัมน์ 754px (เท่าเว็บหลัก) แล้วจัด 2 คอลัมน์ */

@media (min-width: 768px) {
  :root { --column: 754px; }

  body {
    background-image: url("../images/bg-desktop.webp");
    background-position: center top;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }

  .page { box-shadow: 0 0 40px 0 rgb(0 0 0 / 0.6); }

  .section--top .bg-waves { --offset: -40%; }
  .section--bottom .bg-waves { --offset: -100%; }

  .section--top { padding: 20px 28px 186px; }
  .section--bottom { padding: 36px 28px 95px; }

  .logo { width: 133px; }
  .banner { width: 100%; margin-top: 12px; }

  .login {
    grid-template-columns: 1fr 1fr 152px;
    gap: 18px 10px;
    width: 100%;
    margin-top: 28px;
  }
  .login .button--outline { grid-column: 1 / -1; }

  /* รูปซ้าย + ข้อความขวา */
  .split {
    display: grid;
    grid-template-columns: 290px 1fr;
    align-items: center;
    gap: 20px;
    margin-top: 36px;
  }
  .section--bottom .split { margin-top: 0; }
  .split .poster,
  .split .auto-deposit { width: 100%; margin: 0; }
  .split .heading { margin-top: 0; padding-inline: 0; font-size: 22px; }
  .split .copy { max-width: none; }
  .split .cta { width: 286px; margin-top: 16px; }

  .section--providers { padding: 0 28px 40px; }
  .providers-heading { width: 480px; margin-top: -126px; transform: none; }
  .providers {
    grid-template-columns: repeat(7, 1fr);
    gap: 20px 14px;
    padding-inline: 0;
  }
  .providers li { border-radius: 22px; }

  .outro {
    display: grid;
    grid-template-columns: 406fr 292fr;
    align-items: center;
    gap: 20px;
    margin-top: 36px;
  }
  .outro .steps,
  .outro .cta { width: 100%; margin: 0; }
}
