.auth-page {
  width: min(100% - 2rem, 720px);
}

.auth-lead {
  color: var(--ink-2, #2a2a2a);
  margin-bottom: 1.4rem;
}

.auth-form {
  display: grid;
  gap: 0.95rem;
  max-width: 420px;
}

.auth-form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
}

.auth-form input {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 12px;
  background: #fff;
}

.auth-form input:focus {
  outline: 2px solid rgba(255, 59, 0, 0.35);
  border-color: var(--accent, #ff3b00);
}

.required {
  color: var(--err, #b42318);
}

.auth-switch {
  margin-top: 1.4rem;
  color: var(--muted, #6f6f6f);
}

.auth-switch a {
  color: var(--accent, #ff3b00);
  font-weight: 700;
  text-decoration: none;
}

.oauth-block {
  max-width: 420px;
  margin-bottom: 1.2rem;
}

.oauth-label {
  margin: 0 0 0.7rem;
  font-weight: 700;
  color: var(--ink-2, #2a2a2a);
}

.oauth-buttons {
  display: grid;
  gap: 0.6rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1rem;
  border-radius: 999px;
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.2s var(--ease, ease), filter 0.2s ease;
}

.oauth-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

.oauth-yandex {
  background: #fc3f1d;
}

.oauth-vk {
  background: #0077ff;
}

.oauth-google {
  background: #4285f4;
}

.oauth-max {
  background: var(--ink, #0e0e0e);
}

.oauth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.15rem 0 0.2rem;
  color: var(--muted, #6f6f6f);
}

.oauth-divider::before,
.oauth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line, rgba(14, 14, 14, 0.1));
}

.oauth-block--secondary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.75rem;
  margin: 1rem 0 0;
}

.oauth-block--secondary .oauth-label {
  margin: 0;
  color: var(--muted, #6f6f6f);
  font-size: 0.85rem;
  font-weight: 400;
}

.oauth-block--secondary .oauth-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.oauth-block--secondary .oauth-btn {
  box-sizing: border-box;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2, #2a2a2a);
  font-size: 0.85rem;
  font-weight: 600;
  transition: background 0.15s ease;
}

.oauth-block--secondary .oauth-btn:hover {
  background: rgba(14, 14, 14, 0.04);
  transform: none;
  filter: none;
}

.oauth-block--secondary .oauth-vk {
  background: #0077ff;
  border-color: #0077ff;
  color: #fff;
}

.oauth-block--secondary .oauth-vk:hover {
  background: #0066dd;
  border-color: #0066dd;
}

.oauth-block--secondary .oauth-btn:focus-visible {
  outline: 2px solid var(--ink-2, #2a2a2a);
  outline-offset: 3px;
}

.auth-hint {
  margin-top: 1rem;
  color: var(--muted, #6f6f6f);
}

.auth-page > .auth-hint {
  margin: 1rem 0;
  max-width: 520px;
}

.auth-recovery-link {
  justify-self: start;
  color: var(--accent, #ff3b00);
  font-weight: 700;
  text-underline-offset: 0.2em;
  padding-block: 0.4rem;
}

.auth-recovery-link:focus-visible {
  outline: 2px solid var(--accent, #ff3b00);
  outline-offset: 4px;
  border-radius: 4px;
}

.profile-password-section {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  scroll-margin-top: calc(var(--header-h, 4.5rem) + 1rem);
}

.profile-password-section .auth-hint {
  max-width: 420px;
  margin: 0 0 1rem;
}

.profile-layout {
  width: min(100% - 2rem, var(--max, 1200px));
  margin: 2rem auto 3rem;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

.profile-sidebar {
  position: sticky;
  top: calc(var(--header-h, 4.5rem) + 0.75rem);
  background: var(--surface, #faf9f6);
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: var(--radius, 14px);
  padding: 1.15rem;
  box-shadow: var(--shadow, 0 12px 32px rgba(14, 14, 14, 0.07));
}

.profile-sidebar-heading {
  margin: 0 0 0.9rem;
  font-family: var(--font-display, sans-serif);
  letter-spacing: -0.02em;
}

.profile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.profile-nav li + li {
  margin-top: 0.3rem;
}

.profile-nav a {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.profile-nav a:hover {
  background: rgba(14, 14, 14, 0.05);
}

.profile-nav a.active {
  background: var(--ink, #0e0e0e);
  color: #fff;
  font-weight: 700;
}

.profile-panel {
  background: var(--surface, #faf9f6);
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: var(--radius, 14px);
  box-shadow: var(--shadow, 0 12px 32px rgba(14, 14, 14, 0.07));
  padding: clamp(1.2rem, 3vw, 2rem);
}

.profile-panel h1 {
  margin-top: 0;
}

.profile-subheading {
  margin-top: 1.25rem;
  font-size: 1.05rem;
}

.profile-logout {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line, rgba(14, 14, 14, 0.1));
}

.profile-logout .button {
  width: 100%;
}

.orders-cards {
  display: grid;
  gap: 0.85rem;
}

.profile-prints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 1rem;
}

.profile-print-card {
  overflow: hidden;
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 14px;
  background: #fff;
}

.profile-print-preview {
  display: block;
  aspect-ratio: 1 / 1;
  background: var(--paper-deep, #e4e0d8);
}

.profile-print-preview img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.profile-print-info {
  display: grid;
  gap: 0.55rem;
  padding: 0.85rem;
}

.profile-print-info time {
  color: var(--muted, #6f6f6f);
  font-size: 0.82rem;
}

.profile-print-info .button {
  width: 100%;
  padding: 0.65rem 0.75rem;
  text-align: center;
}

@media (min-width: 720px) {
  .orders-cards {
    gap: 1rem;
  }

  .order-card {
    padding: 1.1rem 1.15rem;
  }
}

.order-card {
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 12px;
  background: #fff;
  padding: 0.95rem;
}

.order-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.order-card-label {
  display: block;
  font-size: 0.75rem;
  color: var(--muted, #6f6f6f);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.2rem;
}

.order-card-id {
  font-size: 0.88rem;
  word-break: break-all;
}

.order-card-status {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  background: rgba(14, 14, 14, 0.06);
  font-size: 0.8rem;
  font-weight: 700;
}

.order-card-status--pending {
  background: rgba(212, 168, 60, 0.18);
  color: #8a6a15;
}

.order-card-status--paid {
  background: var(--peach, #f4d5c2);
  color: var(--ink-2, #3f3d38);
}

.order-card-status--shipped {
  background: rgba(226, 111, 78, 0.16);
  color: var(--accent-2, #d45f3d);
}

.order-card-status--done {
  background: #e8f6ee;
  color: var(--ok, #1f7a4c);
}

.order-card-status--cancelled {
  color: #991b1b;
  background: #fee2e2;
}

.order-card-tracking {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--muted, #6f6f6f);
}

.order-card-tracking code {
  color: var(--ink, #2b2a26);
  font-weight: 700;
}

.order-card-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin: 0 0 0.85rem;
  padding: 0;
}

.order-card-meta div {
  margin: 0;
}

.order-card-meta dt {
  margin: 0 0 0.15rem;
  font-size: 0.75rem;
  color: var(--muted, #6f6f6f);
}

.order-card-meta dd {
  margin: 0;
  font-weight: 700;
}

.order-card-items {
  list-style: none;
  margin: 0;
  padding: 0.75rem 0 0;
  border-top: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  display: grid;
  gap: 0.55rem;
}

.order-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.order-item-image-button {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line, rgba(14, 14, 14, 0.1));
  border-radius: 10px;
  background: var(--paper-deep, #e4e0d8);
  cursor: zoom-in;
}

.order-item-image-button:focus-visible {
  outline: 3px solid var(--accent, #ff3b00);
  outline-offset: 2px;
}

.order-item-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.order-item-details {
  min-width: 0;
}

.order-item-name {
  display: block;
  font-weight: 650;
  line-height: 1.3;
}

.order-item-meta {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.85rem;
  color: var(--muted, #6f6f6f);
}

body.order-lightbox-open {
  overflow: hidden;
}

.order-image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
}

.order-image-lightbox.is-open {
  display: flex;
}

.order-image-lightbox[hidden] {
  display: none !important;
}

.order-image-lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.88);
  cursor: zoom-out;
}

.order-image-lightbox-content {
  position: relative;
  z-index: 1;
  max-width: 92vw;
  max-height: 92vh;
}

.order-image-lightbox-content img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}

.order-image-lightbox-close {
  position: absolute;
  top: -0.5rem;
  right: -0.5rem;
  z-index: 1;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--ink, #0e0e0e);
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}

.profile-panel .empty-state {
  color: var(--muted, #6f6f6f);
}

@media (max-width: 860px) {
  .profile-layout {
    grid-template-columns: 1fr;
    width: min(100% - 1.25rem, var(--max, 1200px));
    margin: 0.85rem auto 2rem;
  }

  .profile-sidebar {
    position: static;
  }

  .profile-nav ul {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.4rem;
  }

  .profile-nav li + li {
    margin-top: 0;
  }

  .profile-nav a {
    text-align: center;
    padding: 0.7rem 0.5rem;
    font-size: 0.9rem;
  }
}

.auth-form .auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  cursor: pointer;
}

.auth-form .auth-consent input {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin: 0.15rem 0 0;
  padding: 0;
  accent-color: var(--accent, #ff3b00);
}

.auth-consent a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
