/* Continental — precise reproduction of Figma design (nodes 1001:3 / 1001:13571) */

:root {
  /* Palette mirrored from original site's design tokens */
  --bg-page:      #1c1c1c;   /* --background-color-dark */
  --bg-header:    #282828;   /* --background-color-primary */
  --bg-card:      #282828;   /* login card = primary */
  --bg-input:     #1c1c1c;   /* --input-primary */
  --bg-secondary: #323232;   /* --button-default */
  --bg-secondary-hover: #4a4a4a; /* --button-default-hover */
  --yellow:        #fee600;  /* --button-primary */
  --yellow-hover:  #fed500;  /* --button-primary-hover */
  --text:          #ffffff;
  --text-muted:    #878787;  /* --color-text-secondary */
  --text-tertiary: #737373;
  --shadow-header: 0 4px 42px rgba(5, 5, 5, 0.5);
  --shadow-card: 0 0 18px rgba(4, 4, 4, 0.25);
  --radius-card: 16px;
  --radius-control: 10px;
  --radius-input-inner: 8px;

  --container: 1200px;
  --side-pad: 360px;   /* 1920 layout: (1920 - 1200) / 2 */
}

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

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg-page);
  color: var(--text);
  font-family: "TT Hoves", "Manrope", "Inter", Arial, "Helvetica Neue", sans-serif;
  font-size: 14px;
  line-height: 1.25;
  letter-spacing: -0.015em;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: 0; color: inherit; cursor: pointer; }

/* ---------- Top bar (nav links) ---------- */
.topbar {
  padding: 0 var(--side-pad);
  height: 35px;
}
.topbar__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 100%;
  padding: 8px 0;
  display: flex;
  justify-content: flex-end;
}
.topnav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 16px;
  align-items: center;
}
.topnav__link {
  font-size: 13px;
  line-height: 16px;
  font-weight: 500;
  letter-spacing: -0.015em;
  color: var(--text-muted);
  padding: 0 6px;
  border-radius: 6px;
  transition: color .15s;
}
.topnav__link:hover { color: var(--text); }

/* ---------- Header ---------- */
.header {
  background: var(--bg-header);
  box-shadow: var(--shadow-header);
  padding: 0 var(--side-pad);
  height: 66px;
  position: relative;
  z-index: 10;
}
.header__inner {
  max-width: var(--container);
  margin: 0 auto;
  height: 100%;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 32px;
}
.header__logo { flex: 0 0 auto; display: block; }
.header__logo img { width: 50px; height: 50px; display: block; }

/* Search cluster grows to fill available space */
.header__search {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  gap: 4px;
  align-items: center;
  height: 44px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 12px;
  border-radius: var(--radius-control);
  font-size: 16px;
  line-height: 20px;
  font-weight: 500;
  letter-spacing: -0.24px;
  color: var(--text);
  transition: background-color .15s, transform .05s;
  white-space: nowrap;
  cursor: pointer;
}
.btn:active { transform: translateY(1px); }
.btn .icon { width: 20px; height: 20px; display: block; }

.btn--catalog,
.btn--dark {
  background: var(--bg-secondary);
}
.btn--catalog:hover,
.btn--dark:hover { background: var(--bg-secondary-hover); }

.btn--catalog {
  width: 110px;
  padding: 0;
  font-weight: 600;
}

.btn--dark {
  width: 140px;
  padding: 0;
  background: #3a3a3a;
}
.btn--dark:hover { background: #454545; }

.btn--yellow {
  background: var(--yellow);
  color: #000;
  padding: 0 14px;
}
.btn--yellow:hover { background: var(--yellow-hover); }

/* Search field */
.search {
  flex: 1 1 auto;
  min-width: 0;
  height: 43px;
  background: var(--bg-input);
  border-radius: var(--radius-control);
  display: flex;
  align-items: center;
  padding: 4.5px 12px;
  gap: 4px;
}
.search__tools { display: flex; gap: 0; align-items: center; }
.search__tool {
  width: 26px;
  height: 26px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s;
}
.search__tool:hover { background: rgba(255,255,255,0.06); }
.search__tool img { width: 18px; height: 18px; display: block; }

.search__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 6px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 15.8px;
  letter-spacing: -0.24px;
  outline: none;
}
.search__input::placeholder { color: rgba(255,255,255,0.42); }

.header__actions {
  flex: 0 0 auto;
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ---------- Burger (hidden on desktop) ---------- */
.header__burger {
  display: none;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  border-radius: var(--radius-control);
  background: var(--bg-secondary);
}
.header__burger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.header__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.header__burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.header__burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Mobile nav overlay ---------- */
.mobile-nav {
  display: none;
  background: var(--bg-header);
  padding: 12px var(--side-pad) 16px;
  box-shadow: var(--shadow-header);
  flex-direction: column;
  gap: 4px;
}
.mobile-nav__link {
  padding: 12px;
  border-radius: 10px;
  background: var(--bg-input);
  font-size: 16px;
  color: var(--text);
}
.mobile-nav__link:hover { background: #232323; }

/* ---------- Main / login ---------- */
.main { padding: 20px 0 0; }

.login {
  padding: 100px 0 0;
  display: flex;
  justify-content: center;
}
.login__card {
  position: relative;
  width: 755px;
  height: 420px;
  background: var(--bg-card);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 0;
  display: flex;
  gap: 0;
  overflow: hidden;
}

/* Left artwork panel — flush with card edges, coins over halftone that fades to gray at edges */
.login__art {
  flex: 0 0 345px;
  align-self: stretch;
  background:
    url("assets/halftone-bg.png") no-repeat 0 0 / 755px 420px,
    radial-gradient(ellipse 65% 70% at 50% 55%, transparent 0%, transparent 55%, var(--bg-card) 100%),
    radial-gradient(circle, rgba(255, 255, 255, 0.22) 1px, transparent 1.4px) 0 0 / 7px 7px,
    var(--bg-card);
}

.login__form {
  flex: 1 1 auto;
  min-width: 0;
  padding: 20px 20px 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.login__head { display: flex; flex-direction: column; gap: 8px; }
.login__title {
  margin: 0;
  font-size: 32px;
  line-height: 39px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.4px;
}
.login__sub {
  margin: 0;
  font-size: 16px;
  line-height: 20px;
  color: var(--text);
  letter-spacing: -0.24px;
}
.login__link {
  color: var(--yellow);
  font-weight: 600;
  transition: color .15s;
}
.login__link:hover { color: var(--yellow-hover); text-decoration: underline; }

.login__fields { display: flex; flex-direction: column; gap: 20px; }

.field { display: flex; flex-direction: column; gap: 5px; position: relative; }
.field__error {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 4px;
  font-size: 12px;
  line-height: 14px;
  color: #ff4545;
  letter-spacing: -0.015em;
  white-space: nowrap;
  pointer-events: none;
}
.field__label {
  font-size: 14px;
  line-height: 18px;
  color: var(--text-muted);
  letter-spacing: -0.21px;
}
.field__control {
  position: relative;
  background: var(--bg-input);
  border-radius: var(--radius-control);
  height: 43px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  transition: border-color .15s;
}
.field__control:focus-within { border-color: var(--yellow); }
.field__input {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0 12px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.24px;
  outline: none;
  border-radius: var(--radius-input-inner);
}
.field__input::placeholder { color: rgba(255,255,255,0.42); }
.field__eye {
  flex: 0 0 auto;
  width: 44px;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-right: 14px;
  padding-left: 8px;
  transition: opacity .15s;
}
.field__eye img { width: 24px; height: 16px; display: block; }
.field__eye:hover { opacity: .85; }
.field__eye[aria-pressed="true"] img { opacity: .55; }

.login__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 24px;
}

/* Custom checkbox */
.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}
.check__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.check__box {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  background: var(--bg-input);
  border: 1px solid #383838;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color .15s, border-color .15s;
}
.check__box::after {
  content: "";
  width: 12px;
  height: 6px;
  border-left: 2px solid #000;
  border-bottom: 2px solid #000;
  transform: rotate(-45deg) translate(1px, -1px);
  opacity: 0;
  transition: opacity .1s;
}
.check__input:checked + .check__box {
  background: var(--yellow);
  border-color: var(--yellow);
}
.check__input:checked + .check__box::after { opacity: 1; }
.check__input:focus-visible + .check__box { outline: 2px solid var(--yellow); outline-offset: 2px; }
.check__label {
  font-size: 13px;
  line-height: 16px;
  color: var(--text);
  letter-spacing: -0.015em;
}

.login__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 0;
}
.btn--primary {
  height: 44px;
  border-radius: var(--radius-control);
  background: var(--yellow);
  color: #000;
  font-size: 16px;
  line-height: 20px;
  font-weight: 600;
  letter-spacing: -0.24px;
  transition: background-color .15s;
}
.btn--primary:hover { background: var(--yellow-hover); }
.btn--secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: var(--radius-control);
  background: var(--bg-secondary);
  color: var(--text);
  font-size: 16px;
  line-height: 20px;
  letter-spacing: -0.24px;
  transition: background-color .15s;
}
.btn--secondary:hover { background: var(--bg-secondary-hover); }

/* ==================================================================
   1440 breakpoint — matches Figma node 1001:13571 (side padding = 120)
   ================================================================== */
@media (max-width: 1600px) {
  :root { --side-pad: 120px; }
}

/* Below full 1200 container, shrink gracefully */
@media (max-width: 1439px) {
  :root { --side-pad: max(24px, calc((100vw - 1200px) / 2)); }
}

@media (max-width: 1220px) {
  :root { --side-pad: 24px; }
  .header__inner { gap: 20px; }
  .header__search { gap: 4px; }
}

/* Header mobile-only elements — hidden on desktop */
.header__searchbtn { display: none; }

/* Bottom nav — desktop hides it */
.bottomnav { display: none; }

/* ==================================================================
   Mobile (≤720px) — matches Figma node 1001:27135 (390w default)
   ================================================================== */
@media (max-width: 720px) {
  :root { --side-pad: 10px; }

  body { background: #1c1c1c; padding-bottom: 62px; }

  .topbar { display: none; }

  /* Header 390x56 — burger left, logo center, search right */
  .header {
    height: 56px;
    padding: 0 10px;
  }
  .header__inner {
    padding: 8px 0;
    gap: 24px;
    justify-content: center;
    align-items: center;
  }
  .header__logo {
    order: 2;
    flex: 0 0 40px;
  }
  .header__logo img { width: 40px; height: 40px; }

  .header__burger {
    display: inline-flex;
    order: 1;
    flex: 1 1 0;
    height: 40px;
    background: transparent;
    border-radius: 8px;
    color: var(--text-muted);
    padding: 0;
    justify-content: flex-start;
    align-items: center;
  }
  .header__burger img { width: 20px; height: 20px; display: block; }
  .header__burger[aria-expanded="true"] { color: var(--text); }

  .header__searchbtn {
    display: inline-flex;
    order: 3;
    flex: 1 1 0;
    height: 40px;
    background: transparent;
    border-radius: 8px;
    color: var(--text-muted);
    align-items: center;
    justify-content: flex-end;
    padding: 0;
  }
  .header__searchbtn img { width: 20px; height: 20px; display: block; }
  .header__searchbtn:hover { color: var(--text); }

  .header__search { display: none; }
  .header__actions { display: none; }

  /* Mobile nav sheet */
  .mobile-nav {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    z-index: 20;
    padding: 12px 10px 16px;
  }
  .mobile-nav[data-open="true"] { display: flex; }

  /* Main + login card 370x634, radius 16, padding 10 */
  .main { padding: 16px 0 0; }
  .login { padding: 0 10px; }
  .login__card {
    width: 100%;
    max-width: 370px;
    height: auto;
    min-height: 634px;
    flex-direction: column;
    padding: 10px;
    gap: 0;
    box-shadow: var(--shadow-card);
  }
  .login__art { display: none; }

  .login__form {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 10px 10px 0;
  }

  .login__head { gap: 8px; }
  .login__title {
    font-size: 32px;
    line-height: 39px;
    font-weight: 700;
    letter-spacing: -0.4px;
  }
  .login__sub { font-size: 16px; line-height: 20px; }

  .login__fields { gap: 16px; }

  /* Buttons pinned to bottom of card */
  .login__actions {
    margin-top: auto;
    padding-top: 24px;
    gap: 8px;
  }

  /* Bottom navigation bar 390x62 */
  .bottomnav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: 62px;
    background: var(--bg-header);
    box-shadow: 0 0 24px rgba(4, 4, 4, 0.3);
    padding: 12px;
    z-index: 15;
  }
  .bottomnav__item {
    flex: 1 1 0;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 38px;
    color: var(--text-muted);
    transition: color .15s;
  }
  .bottomnav__icon {
    width: 20px;
    height: 20px;
    display: block;
    opacity: .85;
    transition: opacity .15s;
  }
  .bottomnav__label {
    font-size: 12px;
    line-height: 16px;
    letter-spacing: -0.18px;
  }
  .bottomnav__item:hover { color: var(--text); }
  .bottomnav__item:hover .bottomnav__icon { opacity: 1; }
  .bottomnav__item--active {
    color: var(--yellow);
  }
  .bottomnav__item--active .bottomnav__icon { opacity: 1; }
}

@media (max-width: 400px) {
  .login__card { min-height: calc(100vh - 56px - 62px - 16px - 20px); }
}

/* ==================================================================
   PIN modal
   ================================================================== */
.pin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.pin-modal[hidden] { display: none; }

.pin-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

.pin-modal__dialog {
  position: relative;
  width: 264px;
  min-height: 172px;
  background: #2a2a2a;
  border-radius: 16px;
  padding: 16px 16px 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  animation: pinModalIn .18s ease-out;
  display: flex;
  flex-direction: column;
  font-family: "TT Hoves", "Manrope", "Inter", Arial, sans-serif;
}

@keyframes pinModalIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0)    scale(1);   }
}

.pin-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #9a9a9a;
  border-radius: 8px;
  transition: color .15s, background-color .15s;
}
.pin-modal__close svg { width: 18px; height: 18px; }
.pin-modal__close:hover { color: var(--text); background: rgba(255,255,255,0.06); }

.pin-modal__title {
  margin: 0 0 16px;
  font-size: 20px;
  line-height: 24px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.015em;
  padding-right: 28px;
}

.pin-modal__sub {
  margin: 0;
  width: 232px;
  font-family: "TT Hoves", "Manrope", "Inter", Arial, sans-serif;
  font-size: 13px;
  line-height: 1.25;
  font-weight: 400;
  color: #d3d3d3;
  letter-spacing: -0.015em;
}

.pin-inputs {
  margin-top: auto;
  width: 232px;
  height: 44px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.pin-inputs__cell {
  flex: 1 1 0;
  min-width: 0;
  height: 44px;
  background: var(--bg-input);
  border: 1.5px solid transparent;
  border-radius: 8px;
  color: var(--text);
  font-family: inherit;
  font-size: 20px;
  line-height: 1;
  font-weight: 500;
  text-align: center;
  outline: none;
  caret-color: var(--yellow);
  padding: 0;
  transition: border-color .15s, background-color .15s;
}
.pin-inputs__cell:focus {
  border-color: var(--yellow);
  background: #1c1c1c;
}
.pin-inputs__cell.is-error {
  border-color: #e5484d;
  animation: pinShake .28s ease-in-out;
}

@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-3px); }
  75% { transform: translateX(3px); }
}

/* Loader — yellow wave under inputs (absolute so it doesn't push cells up) */
.pin-modal__loader {
  position: absolute;
  left: 16px;
  bottom: 6px;
  width: 232px;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  opacity: 0;
  transition: opacity .15s;
  pointer-events: none;
}
.pin-modal__loader.is-active { opacity: 1; }
.pin-modal__loader::before {
  content: "";
  display: block;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, var(--yellow) 50%, transparent);
  transform: translateX(-100%);
  animation: pinWave 1s ease-in-out infinite;
}
@keyframes pinWave {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(350%); }
}

.pin-modal__status {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 15px;
  color: var(--text-muted);
  letter-spacing: -0.015em;
  text-align: center;
  pointer-events: none;
}
.pin-modal__status.is-error { color: #e5484d; }
.pin-modal__status.is-ok    { color: var(--yellow); }
