/* ---------- Sign in ---------- */

.auth {
  min-height: calc(100vh - 170px);
  display: grid;
  place-items: center;
  padding: 48px 0 72px;
}

.auth[hidden],
.cabinet[hidden] {
  display: none;
}

.auth__card {
  width: min(520px, 100%);
  padding: 40px 36px 34px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 40px 80px -50px rgba(0, 0, 0, 0.45);
}

.auth__avatar {
  position: relative;
  isolation: isolate;
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--lime);
}

.auth__avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--ink);
}

.auth__avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -2;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), transparent 40%, var(--lime) 70%, transparent);
  animation: spin 4s linear infinite;
}

.auth__avatar svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.auth h1 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: -0.035em;
}

.auth__lead {
  margin: 10px 0 26px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--muted);
}

.auth__switch {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin-bottom: 22px;
  padding: 4px;
  border-radius: 999px;
  background: var(--bg);
}

.auth__switch button {
  border: 0;
  background: none;
  padding: 10px 0;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  color: var(--muted);
  transition: color 0.4s var(--ease);
}

.auth__switch button.is-active {
  color: #fff;
}

.auth__switch-pill {
  position: absolute;
  z-index: -1;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 999px;
  background: var(--ink);
  transition: transform 0.5s var(--ease);
}

.auth__switch[data-mode="register"] .auth__switch-pill {
  transform: translateX(100%);
}

.auth__login-fields[hidden],
.auth__register-fields[hidden] {
  display: none;
}

.auth__hint {
  margin: -4px 0 14px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
}

.auth__sync {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px dashed #cfcfca;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  color: #2f2f2c;
}

.auth__to-register {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 16px;
}

.auth__to-register[hidden] {
  display: none;
}

.auth__switch[hidden],
.auth__perks[hidden],
.auth__form[hidden],
.auth__done[hidden] {
  display: none;
}

.auth__done {
  text-align: center;
  padding: 8px 0 4px;
}

.auth__done h2 {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
}

.auth__loader {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 8px auto 22px;
}

.auth__loader-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), transparent 55%, var(--lime));
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  mask: radial-gradient(farthest-side, transparent calc(100% - 5px), #000 0);
  animation: auth-spin 1.1s linear infinite;
  animation-play-state: paused;
}

.auth__loader-core {
  position: absolute;
  inset: 18px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 0 0 4px rgba(200, 255, 0, 0.18);
}

.auth__loader-core::after {
  content: "";
  position: absolute;
  inset: 30%;
  border-radius: 50%;
  background: var(--lime);
  animation: auth-pulse 1.4s ease-in-out infinite;
  animation-play-state: paused;
}

.auth__done.is-checking .auth__loader-ring,
.auth__done.is-checking .auth__loader-core::after {
  animation-play-state: running;
}

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

@keyframes auth-pulse {
  50% {
    transform: scale(0.72);
    opacity: 0.55;
  }
}

.field input[type="date"] {
  min-height: 56px;
  color-scheme: light;
}

.field input[type="date"] + label,
.field-label--float {
  transform: translateY(-9px) scale(0.78);
  color: var(--ink);
}

.order-row__gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 800;
}

.order-row__gift::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 2px;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--ink);
}

.auth__perks {
  list-style: none;
  margin: 26px 0 0;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}

.auth__perks li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 600;
  color: #4a4a47;
}

.auth__perks li::before {
  content: "";
  width: 8px;
  height: 8px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--ink);
}

/* ---------- Cabinet ---------- */

.cabinet {
  min-height: calc(100vh - 170px);
  padding: 44px 0 96px;
}

.cabinet__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.cabinet__hello {
  display: flex;
  align-items: center;
  gap: 18px;
}

.cabinet__avatar {
  width: 68px;
  height: 68px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--lime);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
}

.cabinet__hello .kicker {
  margin-bottom: 6px;
}

.cabinet h1 {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 52px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.cabinet__stats {
  display: flex;
  gap: 10px;
  margin: 0;
}

.cabinet__stats div {
  min-width: 128px;
  padding: 14px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.cabinet__stats dt {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.cabinet__stats dd {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 800;
}

.cabinet__tabs {
  margin-top: 36px;
}

.cabinet__panel {
  padding-top: 28px;
}

.cabinet__panel.is-entering {
  animation: card-in 0.6s var(--ease);
}

.cabinet__panel .product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* Orders */

.orders {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.order-row {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 24px;
  padding: 18px 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  animation: card-in 0.7s var(--ease) backwards;
  animation-delay: calc(min(var(--i, 0), 10) * 50ms);
  transition: border-color 0.3s ease, transform 0.45s var(--ease);
}

.order-row:hover {
  border-color: #c9c9c4;
  transform: translateY(-2px);
}

.order-row__num {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
}

.order-row__brand {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
}

.order-row__item {
  display: -webkit-box;
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.4;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.order-row__meta {
  display: grid;
  gap: 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-align: right;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(200, 255, 0, 0.45);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.25;
  }
}

.cabinet-empty {
  padding: 56px 24px;
  border: 1px dashed #c9c9c4;
  border-radius: 24px;
  text-align: center;
}

.cabinet-empty[hidden] {
  display: none;
}

.cabinet-empty h3 {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.cabinet-empty p {
  max-width: 40ch;
  margin: 10px auto 24px;
  line-height: 1.5;
  color: var(--muted);
}

/* Profile */

.profile-form {
  max-width: 560px;
}

.profile-form__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 8px;
}

.profile-form__saved {
  font-size: 13px;
  font-weight: 700;
  color: #3a7d00;
  opacity: 0;
}

.profile-form__saved.is-shown {
  animation: flash 2.4s var(--ease);
}

@keyframes flash {
  0% {
    opacity: 0;
    transform: translateX(-6px);
  }
  15%,
  75% {
    opacity: 1;
    transform: none;
  }
  100% {
    opacity: 0;
  }
}

.profile-form__logout {
  margin-left: auto;
  color: #d93025;
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
  .cabinet__panel .product-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .order-row {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 16px;
  }

  .order-row__main {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .order-row__meta {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    gap: 12px;
    text-align: left;
  }

  .status-pill {
    grid-column: 2;
    grid-row: 1;
  }
}

@media (max-width: 600px) {
  .auth__card {
    padding: 32px 22px 28px;
  }

  .cabinet {
    padding-top: 28px;
  }

  .cabinet__stats {
    width: 100%;
  }

  .cabinet__stats div {
    flex: 1;
    min-width: 0;
  }

  .cabinet__panel .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- Cookie / camera / geo consent ---------- */

html.consent-open,
html.consent-open body {
  overflow: hidden;
}

.consent {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  padding: 20px;
}

.consent[hidden] {
  display: none;
}

.consent__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(6px);
}

.consent__card {
  position: relative;
  width: min(420px, 100%);
  padding: 32px 28px 26px;
  border-radius: 28px;
  background: var(--surface);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.55);
}

.consent__avatar {
  position: relative;
  isolation: isolate;
  width: 56px;
  height: 56px;
  margin-bottom: 18px;
  display: grid;
  place-items: center;
  color: var(--lime);
}

.consent__avatar::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  border-radius: 50%;
  background: var(--ink);
}

.consent__avatar::before {
  content: "";
  position: absolute;
  inset: -4px;
  z-index: -2;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--lime), transparent 40%, var(--lime) 70%, transparent);
}

.consent__avatar svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
}

.consent__kicker {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.consent__card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.consent__text {
  margin: 12px 0 10px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--muted);
}

.consent__note {
  margin: 0 0 18px;
  font-size: 12px;
  line-height: 1.45;
  color: #8a8a86;
}

.consent__list {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.consent__list li {
  position: relative;
  padding-left: 22px;
  font-size: 14px;
  font-weight: 600;
}

.consent__list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 0 2px var(--ink);
}

.consent__decline {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-top: 14px;
}

.consent__video {
  position: fixed;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
