/* Sign-in page: User Login (Google) or, when it is on, Guest Login (a code on WhatsApp,
   login.js) with the number and the code inside the same card. The input and the bar under
   it are one box: the bar always says what happens next, in the box's tone. */

/* ---------- views ---------- */
.gl-view > p.muted { margin-top: 10px; font-size: 15px; line-height: 1.6; }
.auth-card[data-moved] .gl-view:not([hidden]) { animation: glIn .34s var(--ease) both; }
@keyframes glIn { from { opacity: 0; transform: translateY(10px); } }

/* ---------- pick: User Login or Guest Login ---------- */
.gl-or { display: flex; align-items: center; gap: 14px; margin-top: 18px; color: var(--ink-3); font-size: 11.5px; font-weight: 650; letter-spacing: .12em; text-transform: uppercase; }
.gl-or::before, .gl-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.btn-google.gl-guest { width: 100%; margin-top: 18px; border: 0; font: inherit; font-size: 15.5px; font-weight: 650; cursor: pointer; }
.btn-google.gl-guest .ic, .gl-go .ic { width: 20px; height: 20px; }
.gl-guest .ic { color: #25D366; }
.auth-points .ic { flex: none; }

/* ---------- number and code ---------- */
.gl-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; height: 32px; margin: -6px 0 16px -10px; padding: 0 10px;
  border: 0; border-radius: 9px; background: none; color: var(--ink-2); font: inherit; font-size: 13.5px; font-weight: 600; cursor: pointer; transition: background .15s, color .15s; }
.gl-back:hover { background: var(--surface-3); color: var(--ink); }
.gl-view[data-view=phone], .gl-view[data-view=code] { display: flex; flex-direction: column; }
.gl-view[hidden] { display: none !important; }
.gl-to { white-space: nowrap; color: var(--ink); }
.gl-form { display: flex; flex-direction: column; margin-top: 26px; }

.gl-box { --tone: var(--ink-2); --tone-bg: var(--surface-2); position: relative; border-radius: 16px; background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-2), 0 1px 2px rgba(15, 23, 42, .05), 0 12px 26px -18px rgba(15, 23, 42, .3); transition: box-shadow .2s; }
:root[data-theme=dark] .gl-box { background: var(--surface-2); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .gl-box { background: var(--surface-2); } }
.gl-box:focus-within { box-shadow: 0 0 0 1px var(--brand-line), var(--focus); }
.gl-box[data-tone=ok] { --tone: var(--bull); --tone-bg: var(--bull-soft); }
.gl-box[data-tone=warn] { --tone: var(--amber); --tone-bg: var(--amber-soft); }
.gl-box[data-tone=err] { --tone: var(--bear); --tone-bg: var(--bear-soft); box-shadow: 0 0 0 1px var(--bear), 0 0 0 4px var(--bear-soft); }
.gl-box.shake { animation: glShake .42s ease-in-out; }
@keyframes glShake { 15%, 85% { transform: translateX(-2px); } 30%, 70% { transform: translateX(4px); } 45% { transform: translateX(-5px); } 58% { transform: translateX(5px); } }

/* the number: country code, then the number */
.gl-tel { display: flex; align-items: stretch; height: 60px; }
.gl-cc { position: relative; display: flex; align-items: center; gap: 4px; flex: none; padding: 0 10px 0 16px; border-right: 1px solid var(--line); border-radius: 16px 0 0 0; cursor: pointer; transition: background .15s; }
.gl-cc:hover { background: var(--surface-3); }
.gl-cc b { font-size: 16px; font-weight: 650; color: var(--ink); letter-spacing: .01em; }
.gl-cc .ic { width: 14px; height: 14px; color: var(--ink-3); }
/* the native picker sits on top, invisible, so a tap anywhere on the code opens it (phones get their own list) */
.gl-cc select { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; font-size: 16px; }
/* one country (India): a fixed +91, nothing to pick */
.gl-cc.one { cursor: default; padding-right: 14px; }
.gl-cc.one:hover { background: none; }
.gl-cc.one select { pointer-events: none; }
.gl-in { flex: 1; min-width: 0; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 19px; font-weight: 600; letter-spacing: .03em; }
/* the whole box shows focus, not the parts inside it */
.gl-in:focus-visible, .gl-otp-in:focus-visible, .gl-cc select:focus-visible { box-shadow: none; }
.gl-cc:has(select:focus-visible) { background: var(--surface-3); }
.gl-in::placeholder { color: var(--ink-4); font-weight: 500; }
.gl-ok { display: grid; place-items: center; width: 26px; height: 26px; margin: auto 16px auto 0; flex: none; border-radius: 50%; background: var(--bull); color: #fff;
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease); }
.gl-ok .ic { width: 15px; height: 15px; stroke-width: 2.6; }
:root[data-theme=dark] .gl-ok { color: #04140C; }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .gl-ok { color: #04140C; } }
.gl-box.valid .gl-ok { opacity: 1; transform: none; }

/* the code: one real input over four boxes, so typing, pasting and autofill all just work */
.gl-otp { position: relative; padding: 14px; }
.gl-cells { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.gl-cells i { display: grid; place-items: center; height: 62px; border-radius: 12px; background: var(--surface-3); box-shadow: inset 0 0 0 1px var(--line);
  font: 700 27px var(--font-num); font-style: normal; color: var(--ink); transition: box-shadow .15s, background .15s, transform .15s var(--ease); }
.gl-cells i.full { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line-2); }
:root[data-theme=dark] .gl-cells i.full { background: var(--surface-3); }
@media (prefers-color-scheme: dark) { :root:not([data-theme=light]) .gl-cells i.full { background: var(--surface-3); } }
.gl-otp.focus .gl-cells i.on { box-shadow: inset 0 0 0 2px var(--brand); background: var(--surface); }
.gl-otp.focus .gl-cells i.on:empty::after { content: ''; width: 2px; height: 26px; border-radius: 1px; background: var(--brand); animation: glCaret 1.05s steps(1) infinite; }
@keyframes glCaret { 50% { opacity: 0; } }
.gl-box[data-tone=err] .gl-cells i.full { box-shadow: inset 0 0 0 1px var(--bear); color: var(--bear); }
.gl-box[data-tone=ok] .gl-cells i.full { box-shadow: inset 0 0 0 1px var(--bull); color: var(--bull); }
.gl-otp-in { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; color: transparent; caret-color: transparent;
  -webkit-text-fill-color: transparent; font-size: 16px; cursor: text; }
.gl-otp-in::selection { background: transparent; }

/* the bar under the input */
.gl-tip { display: flex; align-items: center; gap: 8px; min-height: 40px; margin: 0; padding: 9px 14px; border-top: 1px solid var(--line); border-radius: 0 0 16px 16px;
  background: var(--tone-bg); color: var(--tone); font-size: 13px; font-weight: 600; line-height: 1.4; transition: background .2s, color .2s; }
.gl-tip .ic { width: 16px; height: 16px; flex: none; }
.gl-tip b { font-weight: 700; color: inherit; }
.gl-tip .num { font-variant-numeric: tabular-nums; }
.gl-tip[hidden] { display: none; }
.gl-spin { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.gl-tip.new { animation: glTip .3s var(--ease); }
@keyframes glTip { from { opacity: .35; } }

.gl-go { height: 54px; margin-top: 16px; border-radius: 15px; font-size: 15.5px; }
.gl-fine { margin: 14px 0 0; font-size: 12px; line-height: 1.55; color: var(--ink-3); text-align: center; text-wrap: pretty; }
.btn-google.gl-member { margin-top: 12px; }
.gl-resend { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 0; font-size: 13.5px; color: var(--ink-3); }
.gl-resend button { padding: 4px 2px; border: 0; background: none; color: var(--brand); font: inherit; font-weight: 650; cursor: pointer; }
.gl-resend button:hover { text-decoration: underline; text-underline-offset: 3px; }
.gl-resend button[disabled] { color: var(--ink-3); text-decoration: none; cursor: default; }
.gl-resend-t { font-variant-numeric: tabular-nums; }

/* ---------- signed in ---------- */
.gl-done { padding: 6px 0 4px; text-align: center; }
.gl-done-mark { display: grid; place-items: center; width: 66px; height: 66px; margin: 4px auto 20px; border-radius: 50%; background: var(--bull-soft); color: var(--bull); animation: glPop .5s var(--ease) both; }
.gl-done-mark .ic { width: 30px; height: 30px; stroke-width: 2.6; }
@keyframes glPop { from { opacity: 0; transform: scale(.6); } }

@media (max-width: 640px) {
  .gl-tel { height: 58px; }
  .gl-cells i { height: 58px; font-size: 25px; }
  .gl-cells { gap: 8px; }
}
