/* Sign-in pages (/device, /login). Self-contained: shares the site's colours and type,
   but not landing.css. */

/* Thai glyphs only; Latin falls through to the system font. */
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
  src: url('/assets/thai-400.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
  src: url('/assets/thai-500.ttf') format('truetype');
}
@font-face {
  font-family: 'Noto Sans Thai';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  unicode-range: U+0E01-0E5B, U+200C-200D, U+25CC;
  src: url('/assets/thai-600.ttf') format('truetype');
}

:root {
  color-scheme: light;
  --surface: #fff;
  --surface-subtle: #f8f8f7;
  --ink: #202020;
  --ink-secondary: #666661;
  --line: #e7e7e4;
  --line-strong: #c9c9c4;
  --coral: #ac513e;
  --focus: #4b6f9f;
  /* "Noto Sans Thai" first: WebKit resolves -apple-system to a cascade that already
     covers Thai, so a web font listed after it would never be used. */
  --font: 'Noto Sans Thai', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 20px 28px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-decoration: none;
}
.brand-period {
  color: var(--coral);
}

main {
  width: 100%;
  max-width: 400px;
  margin: 36px 0 auto;
}

.view:focus {
  outline: none;
}

h1 {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 16px;
}
.lead {
  margin-bottom: 24px;
  color: var(--ink-secondary);
}
.fine {
  color: var(--ink-secondary);
  font-size: 14px;
}
.account {
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* The code the app shows, repeated here so the person can compare the two. */
.device-code {
  margin: 0 0 24px;
  padding: 14px 16px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-subtle);
  text-align: center;
}
.device-code dt {
  color: var(--ink-secondary);
  font-size: 14px;
}
.device-code dd {
  margin: 2px 0 0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 28px;
  font-weight: 600;
  letter-spacing: 0.12em;
}

form {
  margin: 0;
}
label {
  display: block;
  margin-bottom: 6px;
  font-size: 15px;
  font-weight: 500;
}
input {
  width: 100%;
  height: 48px;
  margin-bottom: 12px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
input::placeholder {
  color: #767672;
}
input.code-input {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 22px;
  letter-spacing: 0.3em;
  text-align: center;
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 48px;
  padding: 0 18px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.button:hover {
  background: #000;
}
.button-secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}
.button-secondary:hover {
  background: var(--surface-subtle);
}
.button[disabled] {
  opacity: 0.55;
  cursor: default;
}
.button + .button {
  margin-top: 10px;
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link:hover {
  color: var(--coral);
}
.links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 16px;
}

input:focus-visible,
.button:focus-visible,
.link:focus-visible,
a:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--ink-secondary);
  font-size: 14px;
}
.divider::before,
.divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.error {
  margin: 0 0 12px;
  color: var(--coral);
  font-size: 15px;
  font-weight: 500;
}

.status-mark {
  width: 44px;
  height: 44px;
  margin-bottom: 14px;
}

footer {
  width: 100%;
  max-width: 400px;
  margin-top: 40px;
  color: var(--ink-secondary);
  font-size: 13px;
}
footer a {
  color: inherit;
  text-underline-offset: 3px;
  white-space: nowrap;
}
footer a:hover {
  color: var(--coral);
}

@media (max-width: 420px) {
  body {
    padding-top: 28px;
  }
  .device-code dd {
    font-size: 24px;
  }
}
