/* =====================================================
   MELVAIRA — App shell additions
   Builds on style.css tokens. Used by auth/account/app pages only —
   the public landing page (index.html) does not load this file.
   ===================================================== */

.header-cta-ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
}

/* Auth dropdown menu in header */
.auth-menu {
  position: relative;
}

.auth-slot-loading {
  display: inline-block;
  width: 84px;
  height: 32px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, var(--gray-bg) 25%, var(--gray-line) 50%, var(--gray-bg) 75%);
  background-size: 200% 100%;
  animation: auth-loading-shimmer 1.3s ease-in-out infinite;
}

@keyframes auth-loading-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.auth-menu-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  padding: 6px 4px;
}

.auth-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.auth-menu-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  min-width: 180px;
  box-shadow: 0 20px 40px -20px rgba(17, 17, 17, 0.3);
  overflow: hidden;
  z-index: 50;
}

.auth-menu-dropdown.is-open {
  display: block;
}

.auth-menu-dropdown a,
.auth-menu-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
  border-bottom: 1px solid var(--gray-line);
}

.auth-menu-dropdown a:last-of-type {
  border-bottom: 1px solid var(--gray-line);
}

.auth-menu-dropdown button {
  border-bottom: none;
  color: var(--red);
}

.auth-menu-dropdown a:hover,
.auth-menu-dropdown button:hover {
  background: var(--gray-bg);
}

/* =====================================================
   Auth pages (login / signup / forgot / reset)
   ===================================================== */

.auth-page {
  min-height: calc(100vh - 65px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
  background: var(--gray-bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 40px 36px;
}

.auth-card h1 {
  font-size: 26px;
}

.auth-card-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14px;
}

.auth-card form {
  margin-top: 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.field-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--ink);
}

.auth-card .btn {
  width: 100%;
  margin-top: 6px;
}

.auth-switch {
  margin-top: 22px;
  text-align: center;
  font-size: 13.5px;
  color: var(--muted);
}

.auth-switch a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
}

.auth-forgot-link {
  font-size: 12.5px;
  text-align: right;
  margin-top: -8px;
}

.auth-forgot-link a {
  color: var(--muted);
  text-decoration: underline;
}

/* =====================================================
   Auth mode toggle — MODIVO-style segmented control
   ("Mam konto" / "Nie mam konta")
   ===================================================== */

.auth-tabs {
  display: flex;
  border: 1.5px solid var(--gray-line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 28px;
}

.auth-tabs a {
  flex: 1;
  text-align: center;
  padding: 13px 10px;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  color: var(--muted);
  background: var(--gray-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-tabs a.is-active {
  background: var(--white);
  color: var(--ink);
}

.auth-tabs a.is-active::before {
  content: "✓";
  font-weight: 800;
}

/* =====================================================
   Password requirements checklist (live-validated)
   ===================================================== */

.password-checklist {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.password-checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.password-checklist-item .check-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--gray-line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  color: transparent;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.password-checklist-item.is-met {
  color: var(--ink);
}

.password-checklist-item.is-met .check-dot {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--white);
}

/* =====================================================
   Social login row (Google / Facebook / Apple)
   ===================================================== */

.social-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: var(--muted);
  font-size: 12.5px;
}

.social-divider::before,
.social-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--gray-line);
}

.social-row {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.social-btn {
  width: 56px;
  height: 56px;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-line);
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}

.social-btn:hover {
  border-color: var(--ink);
}

.social-btn svg {
  width: 22px;
  height: 22px;
}

.social-btn.social-apple {
  background: var(--ink);
  border-color: var(--ink);
}

.social-btn.social-facebook {
  background: #1877f2;
  border-color: #1877f2;
}

/* =====================================================
   Brand strip / grid (text-based brand tiles — no third-party
   logo artwork is reproduced, only plain typographic brand names)
   ===================================================== */

.brand-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.brand-tile {
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  background: var(--white);
  aspect-ratio: 3 / 2;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.brand-tile:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.brand-tile span {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-align: center;
}

@media (max-width: 860px) {
  .brand-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .brand-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .social-btn {
    width: 50px;
    height: 50px;
  }
}

.auth-banner {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  display: none;
}

.auth-banner.is-visible {
  display: block;
}

.auth-banner.is-error {
  background: #fdeceb;
  color: var(--red);
  border: 1px solid #f6c6c2;
}

.auth-banner.is-success {
  background: var(--pink-bg);
  color: var(--ink);
  border: 1px solid #f5c6db;
}

.dev-note {
  margin-top: 18px;
  padding: 12px 14px;
  background: #fff8e6;
  border: 1px solid #f0dca0;
  border-radius: var(--radius);
  font-size: 12.5px;
  color: #6b5410;
}

.dev-note a {
  color: #6b5410;
  font-weight: 700;
}

/* =====================================================
   App page shell (For You / Favorites / Preferences / Account)
   ===================================================== */

.app-main {
  min-height: calc(100vh - 65px);
  background: var(--white);
}

.app-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 32px;
}

.app-header-row h1 {
  font-size: clamp(24px, 3.4vw, 32px);
}

.app-header-row p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.app-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gray-line);
  margin-bottom: 28px;
}

.app-tab {
  padding: 12px 4px;
  margin-right: 24px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.app-tab.is-active {
  color: var(--ink);
  border-bottom-color: var(--ink);
}

.empty-state {
  text-align: center;
  padding: 64px 20px;
  border: 1px dashed var(--gray-line);
  border-radius: var(--radius);
  color: var(--muted);
}

.empty-state h3 {
  font-size: 19px;
  color: var(--ink);
  margin-bottom: 8px;
}

.empty-state .btn {
  margin-top: 18px;
}

/* Match reasons list on product cards */
.match-reasons {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--gray-line);
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.match-reason {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 11.5px;
  color: var(--muted);
}

.match-reason::before {
  content: "✓";
  color: var(--pink);
  font-weight: 800;
  flex-shrink: 0;
}

.match-score {
  position: absolute;
  top: 10px;
  right: 46px;
  background: var(--ink);
  color: var(--white);
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 8px;
  border-radius: 999px;
}

.card-action-row {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.card-action-row button {
  flex: 1;
  padding: 9px 10px;
  font-size: 12.5px;
  font-weight: 700;
  border-radius: var(--radius);
  border: 1.5px solid var(--gray-line);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}

.card-action-row button.is-active {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

/* =====================================================
   Preferences page ("My Style")
   ===================================================== */

.pref-form-section {
  margin-bottom: 36px;
}

.pref-form-section h2 {
  font-size: 17px;
  margin-bottom: 4px;
}

.pref-form-section-sub {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 16px;
}

.chip-select {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip-select button {
  padding: 10px 18px;
  border-radius: 999px;
  border: 1.5px solid var(--gray-line);
  background: var(--white);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), color 0.2s var(--ease);
}

.chip-select button.is-selected {
  background: var(--ink);
  color: var(--white);
  border-color: var(--ink);
}

.range-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  max-width: 420px;
}

.save-bar {
  position: sticky;
  bottom: 0;
  background: var(--white);
  border-top: 1px solid var(--gray-line);
  padding: 16px 0;
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.save-bar .form-success {
  margin-top: 0;
}

/* =====================================================
   Onboarding
   ===================================================== */

.onboarding-shell {
  max-width: 560px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.onboarding-progress {
  display: flex;
  gap: 6px;
  margin-bottom: 36px;
}

.onboarding-progress span {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: var(--gray-line);
}

.onboarding-progress span.is-complete {
  background: var(--ink);
}

.onboarding-step {
  display: none;
}

.onboarding-step.is-active {
  display: block;
}

.onboarding-step h2 {
  font-size: 26px;
}

.onboarding-step-sub {
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
}

.onboarding-body {
  margin-top: 28px;
}

.onboarding-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 36px;
}

.onboarding-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
}

.onboarding-done {
  text-align: center;
  padding: 40px 0;
}

.onboarding-done .eyebrow {
  justify-content: center;
}

.onboarding-done h2 {
  margin-top: 14px;
}

/* =====================================================
   Notifications
   ===================================================== */

.notif-list {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--gray-line);
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  overflow: hidden;
}

.notif-item {
  background: var(--white);
  padding: 16px 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.notif-item.is-unread {
  background: var(--pink-bg);
}

.notif-item-body strong {
  display: block;
  font-size: 14px;
  margin-bottom: 3px;
}

.notif-item-body span {
  font-size: 12.5px;
  color: var(--muted);
}

.notif-item-time {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
}

/* =====================================================
   Toggle switches (notification preferences)
   ===================================================== */

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-line);
}

.toggle-row-label strong {
  display: block;
  font-size: 14px;
}

.toggle-row-label span {
  font-size: 12.5px;
  color: var(--muted);
}

.toggle-switch {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  cursor: pointer;
  margin: 0;
  z-index: 1;
}

.toggle-switch-track {
  position: absolute;
  inset: 0;
  background: var(--gray-line);
  border-radius: 999px;
  transition: background 0.2s var(--ease);
}

.toggle-switch-track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s var(--ease);
}

.toggle-switch input:checked ~ .toggle-switch-track {
  background: var(--ink);
}

.toggle-switch input:checked ~ .toggle-switch-track::after {
  transform: translateX(18px);
}

.danger-zone {
  margin-top: 40px;
  padding: 24px;
  border: 1px solid #f6c6c2;
  border-radius: var(--radius);
  background: #fdeceb;
}

.danger-zone h3 {
  font-size: 16px;
  color: var(--red);
}

.danger-zone p {
  margin-top: 8px;
  font-size: 13px;
  color: var(--muted);
}

.btn-danger {
  background: var(--red);
  color: var(--white);
  margin-top: 14px;
}

@media (max-width: 640px) {
  .auth-card {
    padding: 28px 22px;
  }

  .range-row {
    grid-template-columns: 1fr;
  }

  .auth-tabs a {
    padding: 12px 8px;
    font-size: 13px;
  }

  .social-row {
    gap: 10px;
  }
}

@media (max-width: 400px) {
  .auth-card {
    padding: 22px 16px;
  }

  .social-btn {
    width: 46px;
    height: 46px;
  }
}

.card-name-link {
  color: inherit;
  text-decoration: none;
}

.card-name-link:hover {
  text-decoration: underline;
}

/* =====================================================
   Discovery page — filters sidebar (desktop) / drawer (mobile)
   ===================================================== */

.discover-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  align-items: start;
}

.filters-panel {
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  padding: 22px;
  position: sticky;
  top: 88px;
}

.filters-panel h3 {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 12px;
}

.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-checkbox-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 220px;
  overflow-y: auto;
}

.filter-checkbox-list label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  color: var(--ink);
  cursor: pointer;
}

.filter-checkbox-list input {
  width: 15px;
  height: 15px;
  accent-color: var(--ink);
}

.filters-clear {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12.5px;
  text-decoration: underline;
  cursor: pointer;
  margin-top: 4px;
}

.filters-toggle-btn {
  display: none;
}

.discover-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}

.discover-count {
  font-size: 13.5px;
  color: var(--muted);
}

.discover-empty {
  grid-column: 1 / -1;
}

.filters-panel-close,
.filters-apply-bar {
  display: none;
}

@media (max-width: 980px) {
  .discover-layout {
    grid-template-columns: 1fr;
  }

  .filters-toggle-btn {
    display: inline-flex;
  }

  .filters-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 60;
    border-radius: 0;
    overflow-y: auto;
    padding: 20px;
    background: var(--white);
  }

  .filters-panel.is-open {
    display: block;
  }

  .filters-panel-close {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--gray-line);
  }

  .filters-panel-close button {
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
  }

  .filters-apply-bar {
    position: sticky;
    bottom: 0;
    background: var(--white);
    padding: 14px 0;
    margin-top: 20px;
    border-top: 1px solid var(--gray-line);
  }
}

/* =====================================================
   Product detail page
   ===================================================== */

.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

.product-media-large {
  aspect-ratio: 3 / 4;
  background: var(--gray-bg);
  border-radius: var(--radius);
  border: 1px solid var(--gray-line);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.product-media-large svg {
  width: 28%;
  color: rgba(17, 17, 17, 0.16);
}

.product-detail-brand {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.product-detail-name {
  font-size: clamp(24px, 3vw, 32px);
  margin-top: 6px;
}

.product-detail-prices {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 16px;
}

.product-detail-prices .price-now {
  font-size: 28px;
}

.product-detail-prices .price-was {
  font-size: 16px;
}

.deal-score-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--pink-bg);
  border: 1px solid #f5c6db;
  font-size: 13px;
  font-weight: 700;
}

.deal-score-badge strong {
  font-size: 15px;
}

.option-group {
  margin-top: 26px;
}

.option-group-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 10px;
}

.option-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.option-pill {
  padding: 9px 16px;
  border: 1.5px solid var(--gray-line);
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 600;
  background: var(--white);
}

.product-detail-actions {
  display: flex;
  gap: 12px;
  margin-top: 30px;
  flex-wrap: wrap;
}

.product-detail-actions .btn {
  flex: 1;
  min-width: 160px;
}

.why-match-box {
  margin-top: 26px;
  padding: 18px 20px;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  background: var(--gray-bg);
}

.why-match-box h3 {
  font-size: 13.5px;
  font-weight: 700;
}

.price-history-chart {
  margin-top: 30px;
}

.price-history-chart h3 {
  font-size: 13.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 12px;
}

.demo-disclaimer {
  margin-top: 30px;
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

.retailer-note {
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* =====================================================
   Account dashboard cards
   ===================================================== */

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 40px;
}

.dashboard-card {
  display: block;
  padding: 20px;
  border: 1px solid var(--gray-line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.dashboard-card:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.dashboard-card strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
}

.dashboard-card span {
  display: block;
  margin-top: 6px;
  font-size: 22px;
  font-weight: 800;
}

.dashboard-card small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

@media (max-width: 860px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}
