/* Kesta leht on Vite’ist väljas (stabiilsed aadressid service workerile).
   Värvid on samad tokenid mis assets/css/main.css @theme. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-400.woff2") format("woff2");
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400.woff2") format("woff2");
}

/* Cyrillic: without these, Russian text falls back to Georgia and the system sans.
   The face declared last is checked first, so Cyrillic letters come from here and Latin ones from above. */
@font-face {
  font-family: "Cormorant Garamond";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/cormorant-garamond-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: Inter;
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/inter-400-cyrillic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

:root {
  --color-black: #141312;
  --color-paper: #faf8f5;
  --color-accent: #8f6e43;
  --color-muted: #5f5a54;
  --color-line: #e6e0d8;
  --color-line-strong: #d1c9bf;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: Inter, system-ui, sans-serif;
}

html {
  background: var(--color-paper);
  color: var(--color-black);
}

body {
  margin: 0;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-paper);
  color: var(--color-black);
  font-family: var(--font-sans);
  padding:
    max(1.5rem, env(safe-area-inset-top))
    max(1.5rem, env(safe-area-inset-right))
    max(1.5rem, env(safe-area-inset-bottom))
    max(1.5rem, env(safe-area-inset-left));
}

html.js:not(.stay) .shell {
  visibility: hidden;
}

[hidden] {
  display: none !important;
}

.shell {
  width: 100%;
  max-width: 22rem;
}

.eyebrow {
  display: block;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted);
}

.p-h {
  margin: 1.5rem 0 0;
  font-family: var(--font-serif);
  font-size: 2.75rem;
  line-height: 1.05;
  font-weight: 500;
  color: var(--color-black);
}

.lead {
  margin: 0.625rem 0 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--color-muted);
}

form .eyebrow {
  margin-top: 1.125rem;
}

.note {
  margin: -0.125rem 0 0;
  font-size: 0.875rem;
  text-align: center;
  color: var(--color-muted);
}

.field-wrap {
  position: relative;
  margin-top: 0.5rem;
}

.field {
  display: block;
  width: 100%;
  box-sizing: border-box;
  height: 3.25rem;
  margin-top: 0;
  padding: 0 1rem;
  border: 1px solid var(--color-line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--color-black);
  font-family: var(--font-sans);
  font-size: 1rem;
}

.field:focus {
  outline: none;
  border-color: var(--color-accent);
}

/* Six drawn cells over one transparent field: one-time-code autofill and paste need a single input. */
.cells {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.5rem;
  margin-top: 1rem;
}

.cells span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 4rem;
  border: 1px solid var(--color-line-strong);
  border-radius: 14px;
  background: #fff;
  font-family: var(--font-serif);
  font-size: 2rem;
  font-variant-numeric: lining-nums;
}

.field-wrap:focus-within .cells span.is-on {
  border-color: var(--color-accent);
}

.field.is-code {
  position: absolute;
  inset: 0;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: transparent;
  caret-color: transparent;
}

.field.is-code::selection {
  background: transparent;
}

.link {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 0.75rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  color: var(--color-black);
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.err {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--color-black);
}

.card-line {
  margin: 1rem 0 0;
  font-size: 0.875rem;
  line-height: 1.45;
}

.card-line a {
  color: var(--color-black);
}

.actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.p-btn,
.p-btn-2 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  height: 3.5rem;
  min-height: 3.5rem;
  padding: 0 1.25rem;
  border-radius: 16px;
  font-family: var(--font-sans);
  font-size: 1rem;
  letter-spacing: 0;
  text-transform: none;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  line-height: 1.3;
  cursor: pointer;
}

.p-btn {
  background: var(--color-black);
  color: var(--color-paper);
  border: 1px solid var(--color-black);
}

.p-btn:hover { background: var(--color-accent); border-color: var(--color-accent); }

.p-btn:disabled { opacity: 0.6; }

.p-btn-2 {
  background: transparent;
  color: var(--color-black);
  border: 1px solid var(--color-black);
}

.p-btn-2:hover { background: var(--color-black); color: var(--color-paper); }

.p-btn:focus-visible,
.p-btn-2:focus-visible,
.langs button:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Phone: the column fills the screen and the primary action stays on a bar at its bottom.
   Sticky, not fixed: a fixed bar ends up under the iOS keyboard. */
@media (max-width: 40rem) {
  body {
    align-items: stretch;
    box-sizing: border-box;
  }

  .shell {
    display: flex;
    flex-direction: column;
    max-width: none;
  }

  .actions {
    position: sticky;
    bottom: 0;
    margin: auto -1.5rem calc(-1 * max(1.5rem, env(safe-area-inset-bottom)));
    padding: 1rem 1.5rem max(1.5rem, env(safe-area-inset-bottom));
    background: #fff;
    border-top: 1px solid var(--color-line);
  }

  .langs {
    margin-bottom: 1.5rem;
  }
}

.langs {
  display: flex;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.langs button {
  min-width: 2.75rem;
  min-height: 2.75rem;
  padding: 0;
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--color-muted);
}

.langs button.is-on {
  color: var(--color-black);
}
