:root {
  color-scheme: light;
  --ink: #172235;
  --muted: #6b7587;
  --line: #dfe4eb;
  --primary: #6658e8;
  --primary-dark: #5548cf;
  --danger: #d73f4c;
  --panel: #f8f9fc;
  font-family: "Noto Sans Thai", system-ui, sans-serif;
}

* { box-sizing: border-box; }

body { margin: 0; min-width: 320px; color: var(--ink); background: #fff; }
button, input { font: inherit; }
a { color: var(--primary); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }

.login-page { min-height: 100svh; display: grid; grid-template-columns: minmax(360px, .9fr) minmax(500px, 1.1fr); }
.welcome-panel { position: relative; display: flex; flex-direction: column; overflow: hidden; padding: 42px clamp(36px, 5vw, 76px); color: #fff; background: linear-gradient(145deg, #4232aa 0%, #6658e8 53%, #8e72f2 100%); }
.welcome-panel::before, .welcome-panel::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.13); border-radius: 50%; }
.welcome-panel::before { width: 580px; height: 580px; right: -360px; top: -210px; }
.welcome-panel::after { width: 420px; height: 420px; left: -260px; bottom: -180px; }
.brand { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 12px; width: fit-content; color: inherit; font-size: 19px; font-weight: 700; }
.brand:hover { text-decoration: none; }
.brand__mark { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #fff; color: var(--primary); box-shadow: 0 8px 25px rgba(22,11,90,.18); }
.brand__mark svg { width: 27px; fill: currentColor; }
.brand__mark circle { fill: #fff; }
.welcome-panel__content { position: relative; z-index: 1; margin: auto 0; max-width: 530px; padding: 72px 0; }
.eyebrow { margin: 0 0 12px; color: var(--primary); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.welcome-panel .eyebrow { color: #d9d4ff; }
.welcome-panel h1 { margin: 0 0 22px; font-size: clamp(40px, 4.2vw, 64px); line-height: 1.2; letter-spacing: -.04em; }
.welcome-panel__content > p:not(.eyebrow) { max-width: 470px; margin: 0; color: rgba(255,255,255,.8); font-size: 17px; line-height: 1.85; }
.room-preview { display: flex; align-items: center; gap: 17px; margin-top: 44px; }
.avatar-stack { display: flex; }
.avatar { display: grid; width: 38px; height: 38px; margin-left: -8px; place-items: center; border: 2px solid #6c5ce5; border-radius: 50%; font-size: 12px; font-weight: 700; }
.avatar:first-child { margin-left: 0; }.avatar--one { background: #f5b7b1; }.avatar--two { background: #8dd5c7; }.avatar--three { background: #f5d879; color: #523e16; }
.room-preview strong, .room-preview span { display: block; }.room-preview strong { font-size: 14px; }.room-preview div > span { margin-top: 2px; color: rgba(255,255,255,.65); font-size: 12px; }
.online-dot { display: inline-block !important; width: 8px; height: 8px; margin-right: 4px; border-radius: 50%; background: #63e6a6; box-shadow: 0 0 0 3px rgba(99,230,166,.18); }
.welcome-panel__footer { position: relative; z-index: 1; margin: 0; color: rgba(255,255,255,.58); font-size: 12px; }

.form-panel { display: grid; place-items: center; padding: 48px clamp(28px, 7vw, 112px); background: var(--panel); }
.form-card { width: min(100%, 470px); }
.brand--mobile { display: none; margin-bottom: 50px; color: var(--ink); }
.form-card__header { margin-bottom: 30px; }
.form-card__header h2 { margin: 0 0 9px; font-size: clamp(30px, 3vw, 40px); letter-spacing: -.03em; }
.form-card__header > p:last-child { margin: 0; color: var(--muted); font-size: 14px; }
.field { margin-bottom: 19px; }
.field label, .field__label-row { font-size: 14px; font-weight: 600; }
.field__label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.field__label-row a { font-size: 12px; }
.field > label { display: block; margin-bottom: 8px; }
.input-wrap { position: relative; }
.input-wrap > svg { position: absolute; left: 16px; top: 50%; width: 20px; transform: translateY(-50%); fill: none; stroke: #8791a2; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; pointer-events: none; }
.input-wrap input { width: 100%; height: 52px; padding: 0 48px; color: var(--ink); border: 1px solid var(--line); border-radius: 12px; outline: none; background: #fff; transition: border-color .2s, box-shadow .2s; }
.input-wrap input::placeholder { color: #a3aab5; }
.input-wrap input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(102,88,232,.11); }
.field.is-invalid input { border-color: var(--danger); box-shadow: 0 0 0 3px rgba(215,63,76,.08); }
.field__error { display: block; min-height: 18px; margin-top: 5px; color: var(--danger); font-size: 11px; }
.icon-button { position: absolute; top: 50%; right: 10px; display: grid; width: 36px; height: 36px; padding: 8px; transform: translateY(-50%); place-items: center; border: 0; border-radius: 8px; color: #8791a2; background: transparent; cursor: pointer; }
.icon-button:hover { color: var(--primary); background: #f3f1ff; }
.icon-button svg { width: 20px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.eye-closed { display: none; }.icon-button[aria-pressed="true"] .eye-open { display: none; }.icon-button[aria-pressed="true"] .eye-closed { display: block; }
.remember { display: flex; align-items: center; gap: 9px; width: fit-content; margin: 2px 0 26px; color: #535d6e; font-size: 13px; cursor: pointer; }
.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.submit-button { display: grid; width: 100%; height: 52px; place-items: center; border: 0; border-radius: 12px; color: #fff; background: var(--primary); box-shadow: 0 8px 20px rgba(102,88,232,.2); font-weight: 700; cursor: pointer; transition: background .2s, transform .2s; }
.submit-button:hover { background: var(--primary-dark); }.submit-button:active { transform: translateY(1px); }.submit-button:disabled { cursor: wait; opacity: .75; }
.spinner { display: none; width: 20px; height: 20px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
.submit-button.is-loading .submit-button__label { display: none; }.submit-button.is-loading .spinner { display: block; }
.form-message { margin-bottom: 20px; padding: 12px 14px; border: 1px solid #f1b8bd; border-radius: 10px; color: #a52834; background: #fff0f1; font-size: 13px; }
.form-message.is-success { border-color: #a8ddc1; color: #217348; background: #edfaf3; }
.x-login-button { display: flex; width: 100%; min-height: 52px; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; color: #fff; background: #0f1419; box-shadow: 0 8px 20px rgba(15,20,25,.14); text-decoration: none; }.x-login-button:hover { background: #272c30; text-decoration: none; }.x-login-button span { font-size: 21px; font-family: Arial, sans-serif; }.x-login-button strong { font-size: 13px; }
.line-login-button { display: flex; width: 100%; min-height: 52px; margin-top: 10px; align-items: center; justify-content: center; gap: 10px; border-radius: 12px; color: #fff; background: #06c755; box-shadow: 0 8px 20px rgba(6,199,85,.2); text-decoration: none; }
.line-login-button:hover { color: #fff; background: #05b84d; text-decoration: none; }
.line-login-button span { display: grid; width: 24px; height: 24px; place-items: center; border-radius: 50%; background: #fff; }
.line-login-button svg { width: 18px; height: 18px; fill: #06c755; }
.line-login-button strong { font-size: 13px; }
.signup-prompt { margin: 28px 0 0; text-align: center; font-size: 14px; }.terms { margin: 34px auto 0; max-width: 390px; color: #9299a5; font-size: 10px; line-height: 1.7; text-align: center; }.terms a { color: #727b89; font-weight: 500; text-decoration: underline; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 25px 0 17px; color: #9299a5; font-size: 11px; white-space: nowrap; }
.auth-divider[hidden] { display: none; }
.auth-divider::before, .auth-divider::after { content: ""; width: 100%; height: 1px; background: var(--line); }
.auth-choice-button { display: flex; width: 100%; min-height: 64px; padding: 10px 14px; align-items: center; gap: 12px; border: 0; border-radius: 12px; color: #fff; text-align: left; background: var(--primary); box-shadow: 0 8px 20px rgba(102,88,232,.18); cursor: pointer; transition: background .2s, transform .2s; }
.auth-choice-button:hover { background: var(--primary-dark); transform: translateY(-1px); }
.auth-choice-button[hidden] { display: none; }
.auth-choice-button__icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: #fff; background: rgba(255,255,255,.15); }
.auth-choice-button__icon svg { width: 22px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.auth-choice-button > span:nth-child(2) { display: grid; gap: 1px; }
.auth-choice-button strong { font-size: 13px; }.auth-choice-button small { color: rgba(255,255,255,.7); font-size: 10px; }
.auth-choice-button .guest-button__arrow { stroke: rgba(255,255,255,.75); }
.guest-button { display: flex; width: 100%; min-height: 64px; padding: 10px 14px; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: 12px; color: var(--ink); text-align: left; background: #fff; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.guest-button[hidden] { display: none; }
.guest-button:hover { border-color: #bdb5f4; background: #faf9ff; transform: translateY(-1px); }
.guest-button__icon { display: grid; width: 39px; height: 39px; flex: 0 0 auto; place-items: center; border-radius: 10px; color: var(--primary); background: #efedff; }
.guest-button__icon svg { width: 21px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-width: 1.7; }
.guest-button > span:nth-child(2) { display: grid; gap: 1px; }
.guest-button strong { font-size: 13px; }.guest-button small { color: var(--muted); font-size: 10px; }
.guest-button__arrow { width: 18px; margin-left: auto; fill: none; stroke: #9299a5; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.guest-form { margin-top: 16px; padding: 18px; border: 1px solid #d7d2fa; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(48,39,115,.07); }
.guest-form[hidden] { display: none; }
.expandable-auth-form { padding: 18px; border: 1px solid #d7d2fa; border-radius: 14px; background: #fff; box-shadow: 0 10px 30px rgba(48,39,115,.07); }
.expandable-auth-form[hidden] { display: none; }
.expandable-auth-form .remember { margin-bottom: 20px; }
.guest-form__header { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 17px; }
.guest-form__header h3 { margin: 0 0 3px; font-size: 16px; }.guest-form__header p { margin: 0; color: var(--muted); font-size: 10px; }
.close-button { width: 30px; height: 30px; padding: 0; border: 0; border-radius: 8px; color: #7c8491; background: #f2f3f6; font-size: 21px; line-height: 1; cursor: pointer; }
.close-button:hover { color: var(--ink); background: #e8eaf0; }
.guest-form .field { margin-bottom: 2px; }
.guest-notice { display: flex; gap: 6px; margin: 0 0 14px; color: #7d8490; font-size: 9px; line-height: 1.55; }
.submit-button--guest { height: 47px; }
.form-card--register { width: min(100%, 650px); }
.register-page { grid-template-columns: minmax(340px, .78fr) minmax(620px, 1.22fr); }
.register-page .form-panel { padding-top: 34px; padding-bottom: 34px; }
.register-page .form-card__header { margin-bottom: 22px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.feature-list { display: grid; gap: 16px; margin: 42px 0 0; padding: 0; list-style: none; color: rgba(255,255,255,.86); font-size: 14px; }
.feature-list li { display: flex; align-items: center; gap: 12px; }
.feature-list li span { display: grid; width: 25px; height: 25px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: #fff; background: rgba(255,255,255,.16); font-weight: 700; }
.password-meter { margin: -8px 0 21px; color: var(--muted); font-size: 10px; }
.password-meter__bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; margin-bottom: 6px; }
.password-meter__bars span { height: 3px; border-radius: 5px; background: var(--line); transition: background .2s; }
.password-meter[data-score="1"] span:nth-child(1) { background: #e1515d; }
.password-meter[data-score="2"] span:nth-child(-n+2) { background: #e5a13d; }
.password-meter[data-score="3"] span:nth-child(-n+3) { background: #64b989; }
.password-meter[data-score="4"] span { background: #31a56a; }
.terms-check { align-items: flex-start; margin-bottom: 3px; line-height: 1.55; }
.terms-check input { margin-top: 2px; flex: 0 0 auto; }
.standalone-error { display: block; min-height: 20px; margin-bottom: 10px; color: var(--danger); font-size: 11px; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 800px) {
  .login-page { grid-template-columns: 1fr; }
  .welcome-panel { display: none; }
  .form-panel { min-height: 100svh; padding: 36px 22px; }
  .brand--mobile { display: inline-flex; }
}

@media (max-width: 1050px) and (min-width: 801px) {
  .register-page { grid-template-columns: minmax(300px, .7fr) minmax(480px, 1.3fr); }
  .register-page .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 600px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 420px) {
  .form-panel { place-items: start stretch; }
  .brand--mobile { margin-bottom: 44px; }
  .form-card__header { margin-bottom: 26px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation-duration: .01ms !important; } }
.placeholder-page { display: grid; min-height: 100svh; padding: 24px; place-items: center; text-align: center; background: var(--panel); }
.placeholder-page > div { width: min(100%, 520px); padding: 48px; border-radius: 20px; background: #fff; box-shadow: 0 20px 60px rgba(31,25,89,.09); }
.placeholder-page h1 { margin: 0 0 12px; }.placeholder-page p:not(.eyebrow) { margin: 0 0 28px; color: var(--muted); }

.seo-content { padding: 78px 24px; background: #fff; }
.seo-content__inner { width: min(1080px, 100%); margin: 0 auto; }
.seo-content__header { max-width: 720px; margin-bottom: 38px; }
.seo-content h2 { margin: 0 0 12px; font-size: clamp(26px, 3vw, 38px); letter-spacing: -.025em; }
.seo-content p { color: var(--muted); line-height: 1.8; }
.seo-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.seo-feature-grid article { padding: 26px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); }
.seo-feature-grid h3 { margin: 0 0 8px; font-size: 18px; }
.seo-feature-grid p { margin: 0; font-size: 14px; }
.seo-howto { margin-top: 52px; padding: 34px; border-radius: 18px; background: #f0eeff; }
.seo-howto h2 { font-size: 24px; }
.seo-howto ol { display: grid; gap: 10px; margin: 18px 0 0; padding-left: 24px; color: #4f5868; line-height: 1.7; }
.seo-links { display: flex; flex-wrap: wrap; gap: 14px 24px; margin-top: 38px; padding-top: 26px; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 760px) {
  .seo-content { padding: 54px 22px; }
  .seo-feature-grid { grid-template-columns: 1fr; }
  .seo-howto { padding: 25px; }
}
