/* The sign-up page. Colours, radius, shadows and motion come from tokens.css (the identity, copied as is). */

@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/readex-pro-arabic.woff2') format('woff2');
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}

@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/readex-pro-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Readex Pro';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/fonts/readex-pro-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--shf-bg);
  color: var(--shf-ink);
  font-family: var(--shf-font-ui);
  font-size: var(--shf-text-md);
  line-height: var(--shf-leading-body);
  -webkit-font-smoothing: antialiased;
}

h1,
h2 {
  margin: 0;
  line-height: var(--shf-leading-tight);
  text-wrap: balance;
}

p {
  margin: 0;
  text-wrap: pretty;
}

a {
  color: var(--shf-brand-hover);
  text-underline-offset: 3px;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--shf-focus);
  outline-offset: 2px;
}

/* Skip link: the first focusable element. */
.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: -200px;
  z-index: 10;
  padding: 10px 14px;
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface);
  color: var(--shf-ink);
  box-shadow: var(--shf-shadow-2);
  font-weight: 600;
  text-decoration: none;
}

.skip:focus {
  top: 16px;
}

/* The frame is the platform's auth page (frontend src/features/auth/auth-card-page.tsx):
   phones get the small drawing and a flat form; from 1024 px the desk drawing fills the page behind a card. */
body {
  position: relative;
  overflow-x: clip;
}

.top,
main,
.foot {
  position: relative;
}

/* Header: the logo and the language switch. */
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 0;
}

.logo {
  display: block;
  width: auto;
  height: 40px;
}

.lang {
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--shf-line-strong);
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface);
  font-size: var(--shf-text-sm);
  font-weight: 600;
  cursor: pointer;
  transition: border-color var(--shf-dur-fast) var(--shf-ease), transform var(--shf-dur-fast) var(--shf-ease);
}

.lang:hover {
  border-color: var(--shf-ink-3);
}

.lang:active {
  transform: scale(0.96);
}

main {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card {
  display: flex;
  flex-direction: column;
  gap: 16px;
  flex-grow: 1;
  padding: 16px 20px 24px;
  animation: shf-enter 0.7s var(--shf-ease) 0.25s both;
}

.art {
  display: flex;
  justify-content: center;
}

.art .ok {
  stroke: var(--shf-success);
}

.head {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* The drawings: lines in ink, the pen's line and pencil in red. */
.desk,
.desk-mobile {
  stroke: var(--shf-ink);
}

.desk {
  display: none;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.desk-mobile {
  display: block;
  width: calc(100% - 40px);
  height: 120px;
  margin: 16px 20px 0;
}

.f-surface { fill: var(--shf-surface); }
.f-surface-2 { fill: var(--shf-surface-2); }
.f-paper { fill: var(--shf-bg); }
.f-brand { fill: var(--shf-brand); }
.f-tea { fill: #b5523b; }
.f-skin { fill: #e9b9a4; }
.s-brand { stroke: var(--shf-brand); }
.dot { fill: var(--shf-brand); stroke: none; }

.foot {
  display: none;
}

@media (min-width: 1024px) {
  .desk { display: block; }
  .desk-mobile { display: none; }

  .top {
    height: 88px;
    padding: 0 64px;
  }

  .logo { height: 52px; }

  .card {
    flex-grow: 0;
    width: 440px;
    margin: 24px auto auto;
    padding: 36px 36px 28px;
    gap: 18px;
    border-radius: 24px;
    background: var(--shf-surface);
    box-shadow: var(--shf-shadow-2);
  }

  .head {
    gap: 6px;
    text-align: center;
  }

  .foot {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 18px;
    padding: 24px 32px 28px;
    font-size: 13px;
    color: var(--shf-ink-2);
  }

  .foot .foot-link {
    color: var(--shf-ink-2);
    font-size: 13px;
    font-weight: 400;
  }

  .foot .foot-link:hover {
    color: var(--shf-ink);
  }
}

h1 {
  font-size: var(--shf-text-2xl);
  font-weight: 700;
}

h1:focus {
  outline: none;
}

.lead {
  color: var(--shf-ink-2);
  font-size: 15px;
}

.step {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

label,
.label {
  font-size: var(--shf-text-sm);
  font-weight: 600;
}

input[type='text'],
input[type='email'] {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--shf-line-strong);
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface);
  font-size: 15px;
  transition: border-color var(--shf-dur-fast) var(--shf-ease), box-shadow var(--shf-dur-fast) var(--shf-ease);
}

input::placeholder {
  color: var(--shf-ink-3);
}

input[type='text']:hover,
input[type='email']:hover {
  border-color: var(--shf-ink-3);
}

input:focus,
input:focus-visible {
  outline: none;
  border-color: var(--shf-focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--shf-focus) 22%, transparent);
}

input[aria-invalid='true'] {
  border-color: var(--shf-danger);
}

.field-error {
  font-size: 13px;
  color: var(--shf-danger);
}

/* The honeypot: off screen, never seen by people. */
.trap {
  position: absolute;
  inset-inline-start: -9999px;
  top: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

/* Buttons */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: var(--shf-radius-md);
  background: var(--shf-brand);
  color: var(--shf-on-brand);
  font-size: var(--shf-text-md);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--shf-dur-fast) var(--shf-ease), transform var(--shf-dur-fast) var(--shf-ease);
}

.btn:hover {
  background: var(--shf-brand-hover);
}

.btn:active {
  transform: scale(0.96);
}

.btn:disabled {
  opacity: 0.45;
  cursor: default;
  transform: none;
  background: var(--shf-brand);
}

.btn[aria-busy='true'] {
  opacity: 0.8;
}

.btn-secondary {
  background: var(--shf-surface);
  color: var(--shf-ink);
  border: 1px solid var(--shf-line-strong);
}

.btn-secondary:hover {
  background: var(--shf-surface-2);
}

.spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: shf-spin 0.8s linear infinite;
}

.btn[aria-busy='true'] .spinner {
  display: inline-block;
}

.link {
  position: relative;
  padding: 0;
  border: 0;
  background: none;
  color: var(--shf-brand-hover);
  font-size: var(--shf-text-sm);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

/* A larger tap area without moving the text. */
.link::after {
  content: '';
  position: absolute;
  inset: -12px -6px;
}

.link:hover {
  text-decoration-thickness: 2px;
}

/* Notes and alerts */
.note {
  font-size: 13px;
  color: var(--shf-ink-2);
  text-align: center;
}

.alert {
  padding: 12px 14px;
  border-radius: var(--shf-radius-md);
  font-size: var(--shf-text-sm);
  font-weight: 600;
}

.alert-danger {
  background: var(--shf-danger-soft);
  color: var(--shf-danger);
}

.alert-neutral {
  background: var(--shf-surface-2);
  color: var(--shf-ink);
  text-align: center;
}

.status {
  min-height: 0;
  font-size: 13px;
  color: var(--shf-success);
  text-align: center;
}

.status:empty {
  display: none;
}

/* Step 2 */
.sent-to {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface-2);
  font-size: var(--shf-text-sm);
}

.sent-to b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}

.code {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.code input {
  width: 100%;
  height: 58px;
  padding: 0;
  border: 1px solid var(--shf-line-strong);
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface);
  text-align: center;
  font-size: 24px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  caret-color: var(--shf-brand);
  transition: border-color var(--shf-dur-fast) var(--shf-ease), box-shadow var(--shf-dur-fast) var(--shf-ease);
}

.code input.filled {
  border-color: var(--shf-ink-2);
}

.code.bad input {
  border-color: var(--shf-danger);
  animation: shf-shake 0.35s;
}

.resend-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  font-size: var(--shf-text-sm);
  color: var(--shf-ink-2);
}

.resend-row b {
  color: var(--shf-ink);
  font-variant-numeric: tabular-nums;
}

/* Step 3 */
.done-text {
  text-align: center;
  color: var(--shf-ink-2);
}

/* Loading */
.skeleton-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.skeleton {
  display: block;
  height: 72px;
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface-2);
  animation: shf-pulse 1.4s ease-in-out infinite;
}

.skeleton-btn {
  height: 52px;
}

/* The privacy sheet */
.sheet {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  padding: 24px;
  border: 0;
  border-radius: var(--shf-radius-lg);
  background: var(--shf-surface);
  color: var(--shf-ink);
  box-shadow: var(--shf-shadow-2);
}

.sheet::backdrop {
  background: rgb(21 19 17 / 0.5);
}

.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.sheet h2 {
  font-size: var(--shf-text-xl);
}

.close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: var(--shf-radius-md);
  background: var(--shf-surface-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.privacy-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 16px;
  padding-inline-start: 20px;
  font-size: 15px;
}

.privacy-list a {
  word-break: break-all;
}


/* Motion: the platform's drawing timings (frontend globals.css). One entrance, then small loops. */
@keyframes shf-draw {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}

@keyframes shf-enter {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: none; }
}

@keyframes shf-pop {
  0% { opacity: 0; transform: scale(0.6); }
  70% { opacity: 1; transform: scale(1.06); }
  100% { opacity: 1; transform: none; }
}

@keyframes shf-steam {
  0% { opacity: 0; transform: translateY(6px); }
  40% { opacity: 1; }
  100% { opacity: 0; transform: translateY(-14px); }
}

@keyframes shf-bob {
  50% { transform: translateY(-6px); }
}

@keyframes shf-blink {
  50% { opacity: 0.35; }
}

@keyframes shf-pencil {
  from { transform: translate(-120px, 60px) rotate(32deg); }
  to { transform: rotate(32deg); }
}

@keyframes shf-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

@keyframes shf-spin {
  to { transform: rotate(360deg); }
}

@keyframes shf-pulse {
  50% { opacity: 0.55; }
}

.draw {
  stroke-dasharray: 1;
  animation: shf-draw 1.4s var(--shf-ease) both;
}

.pop {
  animation: shf-pop 0.6s var(--shf-ease) both;
}

/* A loop moves around its own box, not the drawing's corner. */
.loop,
.own,
.pencil {
  transform-box: fill-box;
}

.own,
.pencil {
  transform-origin: center;
}

.steam { animation: shf-steam 2.6s ease-in-out infinite both; }
.bob { animation: shf-bob 4s ease-in-out infinite; }
.blink { animation: shf-blink 1.8s ease-in-out infinite; }
.pencil { animation: shf-pencil 1.3s var(--shf-ease) both; }

/* Delays (the platform's delay-* classes; no inline styles, the CSP forbids them). */
.d1 { animation-delay: 0.2s; }
.d2 { animation-delay: 0.55s; }
.w100 { animation-delay: 0.1s; }
.w350 { animation-delay: 0.35s; }
.w400 { animation-delay: 0.4s; }
.w700 { animation-delay: 0.7s; }
.w750 { animation-delay: 0.75s; }
.w900 { animation-delay: 0.9s; }
.w1050 { animation-delay: 1.05s; }
.w1100 { animation-delay: 1.1s; }
.w1400 { animation-delay: 1.4s; }
.w1450 { animation-delay: 1.45s; }
.w1500 { animation-delay: 1.5s; }
.w1600 { animation-delay: 1.6s; }
.w1900 { animation-delay: 1.9s; }
.w2000 { animation-delay: 2s; }
.w2400 { animation-delay: 2.4s; }
.w2900 { animation-delay: 2.9s; }

@media (prefers-reduced-motion: reduce) {
  .draw { animation: none; stroke-dashoffset: 0; }
  .pop,
  .steam,
  .bob,
  .blink,
  .card,
  .code.bad input,
  .skeleton,
  .spinner { animation: none; }
  .pencil { animation: none; transform: rotate(32deg); }
  .btn,
  .lang,
  input { transition: none; }
}

/* Small phones */
@media (max-width: 360px) {
  .code { gap: 6px; }
  .code input { height: 52px; font-size: 22px; }
}
