@font-face {font-family: "Vazir"; src: url("../fonts/Vazir.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap;}
@font-face {font-family: "Vazir"; src: url("../fonts/Vazir-Medium.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap;}
@font-face {font-family: "Vazir"; src: url("../fonts/Vazir-Bold.woff2") format("woff2"); font-weight: 700; font-style: normal; font-display: swap;}
/* ===== Mahour — Auth page (login / signup) ===== */
:root {
  --radius: 0.75rem;
  --background: oklch(0.974 0.012 80);
  --foreground: oklch(0.22 0.025 52);
  --card: oklch(0.99 0.006 75);
  --primary: oklch(0.49 0.13 26);
  --primary-foreground: oklch(0.985 0.006 75);
  --secondary: oklch(0.934 0.021 75);
  --muted: oklch(0.94 0.013 75);
  --muted-foreground: oklch(0.49 0.025 58);
  --border: oklch(0.85 0.018 74);
  --surface-float: oklch(0.99 0.006 75 / 92%);
  --glass: oklch(0.99 0.006 75 / 64%);
  --glass-line: oklch(1 0 0 / 72%);
  --rating: oklch(0.72 0.15 73);
  --success: oklch(0.5 0.1 158);
  --danger: oklch(0.55 0.19 27);
  --shadow-elegant: 0 18px 42px -18px oklch(0.49 0.13 26 / 45%);
  --shadow-hero: 0 35px 80px -34px oklch(0.22 0.025 52 / 40%);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  border-color: var(--border);
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: "Vazir", ui-sans-serif, system-ui, sans-serif;
  line-height: 1.6;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  background: none;
  border: none;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

input {
  font-family: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

[hidden] {
  display: none !important;
}

/* ===== Page shell ===== */
.auth-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
  position: relative;
}

@media (min-width: 1024px) {
  .auth-page {
    grid-template-columns: 1.05fr 0.95fr;
  }
}

/* ===== Brand panel ===== */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 3rem 3.5rem;
  background: linear-gradient(150deg, oklch(0.95 0.03 140), var(--background) 60%);
  border-left: 1px solid var(--glass-line);
}

@media (min-width: 1024px) {
  .auth-brand {
    display: flex;
  }
}

.auth-brand .logo {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  width: fit-content;
}

.auth-brand .logo-icon {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid oklch(0.49 0.13 26 / 25%);
  background: oklch(0.49 0.13 26 / 10%);
  color: var(--primary);
}

.auth-brand .logo-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.auth-brand .logo-text {
  font-size: 1.5rem;
  font-weight: 900;
}

.brand-content {
  position: relative;
  z-index: 2;
  max-width: 26rem;
}

.brand-eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--primary);
  margin-bottom: 1.5rem;
}

.eyebrow-line {
  height: 1px;
  width: 2.5rem;
  background: var(--primary);
}

.brand-title {
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1.3;
}

.brand-title span {
  display: block;
  color: var(--primary);
}

.brand-lead {
  margin-top: 1.25rem;
  color: var(--muted-foreground);
  line-height: 2;
}

.brand-points {
  margin-top: 2.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
  font-weight: 600;
}

.brand-points li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.point-icon {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: oklch(0.99 0.006 75 / 75%);
  border: 1px solid var(--glass-line);
  color: var(--primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.point-icon svg {
  width: 0.9rem;
  height: 0.9rem;
}

.brand-decor {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}

.blob {
  position: absolute;
  border-radius: 999px;
  filter: blur(60px);
  opacity: 0.55;
}

.blob-a {
  width: 22rem;
  height: 22rem;
  background: oklch(0.8 0.09 140);
  bottom: -8rem;
  inset-inline-end: -6rem;
}

.blob-b {
  width: 16rem;
  height: 16rem;
  background: oklch(0.75 0.1 26);
  top: -5rem;
  inset-inline-start: -4rem;
}

.glass-ring {
  position: absolute;
  width: 26rem;
  height: 26rem;
  border-radius: 999px;
  border: 1px solid var(--glass-line);
  top: 50%;
  inset-inline-end: -10rem;
  transform: translateY(-50%);
}

/* ===== Form panel ===== */
.auth-form-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.25rem 3rem;
  min-height: 100vh;
  position: relative;
}

@media (min-width: 640px) {
  .auth-form-wrap {
    padding: 3rem 2rem;
  }
}

.auth-card {
  width: 100%;
  max-width: 26rem;
  border-radius: 1.75rem;
  border: 1px solid var(--glass-line);
  background: var(--glass);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  box-shadow: var(--shadow-hero);
  padding: 2rem 1.75rem;
}

@media (min-width: 640px) {
  .auth-card {
    padding: 2.5rem 2.25rem;
  }
}

/* Tabs */
.auth-tabs {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 0.3rem;
  border-radius: 999px;
  background: var(--secondary);
  margin-bottom: 1.75rem;
}

.auth-tab {
  position: relative;
  z-index: 2;
  padding: 0.65rem 1rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--muted-foreground);
  border-radius: 999px;
  transition: color 0.25s ease;
}

.auth-tab.is-active {
  color: var(--primary-foreground);
}

.auth-tab-indicator {
  position: absolute;
  z-index: 1;
  top: 0.3rem;
  bottom: 0.3rem;
  left: 0;
  width: 0;
  /* size and position are set by JS to match the active tab exactly */
  border-radius: 999px;
  background: var(--primary);
  box-shadow: var(--shadow-elegant);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), width 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Panels */
.auth-panel {
  display: none;
  flex-direction: column;
  gap: 1.1rem;
  animation: fade-up 0.35s ease;
}

.auth-panel.is-active {
  display: flex;
}

@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.auth-heading {
  font-size: 1.4rem;
  font-weight: 900;
}

.auth-sub {
  font-size: 0.85rem;
  color: var(--muted-foreground);
  margin-top: -0.5rem;
}

/* Fields */
.field {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.field label {
  font-size: 0.82rem;
  font-weight: 700;
}

.input-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  height: 3rem;
  border-radius: 0.9rem;
  border: 1px solid var(--glass-line);
  background: oklch(0.99 0.006 75 / 70%);
  padding-inline: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrap:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.49 0.13 26 / 14%);
}

.input-wrap.has-error {
  border-color: var(--danger);
}

.input-icon {
  display: grid;
  place-items: center;
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.input-icon svg {
  width: 1.05rem;
  height: 1.05rem;
}

.input-wrap input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: transparent;
  border: none;
  outline: none;
  font-size: 0.9rem;
  color: inherit;
}

.input-wrap input::placeholder {
  color: var(--muted-foreground);
}

.input-toggle {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  color: var(--muted-foreground);
  padding: 0.25rem;
}

.input-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.input-toggle:hover {
  color: var(--foreground);
}

.field-error {
  display: none;
  font-size: 0.75rem;
  color: var(--danger);
  font-weight: 600;
}

.field-error.is-visible {
  display: block;
}

.field-hint {
  font-size: 0.75rem;
  color: var(--muted-foreground);
}

/* Password strength */
.pw-strength {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.35rem;
  margin-top: 0.15rem;
}

.pw-strength span {
  height: 4px;
  border-radius: 999px;
  background: var(--secondary);
  transition: background 0.25s ease;
}

.pw-strength.level-1 span:nth-child(1) {
  background: var(--danger);
}

.pw-strength.level-2 span:nth-child(-n+2) {
  background: var(--rating);
}

.pw-strength.level-3 span:nth-child(-n+3) {
  background: oklch(0.65 0.13 90);
}

.pw-strength.level-4 span {
  background: var(--success);
}

/* Row: remember + forgot */
.field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.82rem;
}

.link-muted {
  color: var(--muted-foreground);
  font-weight: 600;
  transition: color 0.2s;
}

.link-muted:hover {
  color: var(--primary);
}

.link-inline {
  color: var(--primary);
  font-weight: 700;
}

.link-inline:hover {
  text-decoration: underline;
}

/* Checkbox */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.checkbox input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.check-box {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 0.35rem;
  border: 1px solid var(--border);
  background: var(--surface-float);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.check-box::after {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 0.15rem;
  background: var(--primary-foreground);
  clip-path: polygon(14% 44%, 0 65%, 50% 100%, 100% 16%, 80% 0%, 43% 62%);
  transform: scale(0);
  transition: transform 0.15s ease;
}

.checkbox input:checked+.check-box {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox input:checked+.check-box::after {
  transform: scale(1);
}

.checkbox input:focus-visible+.check-box {
  box-shadow: 0 0 0 3px oklch(0.49 0.13 26 / 20%);
}

.checkbox-terms {
  align-items: flex-start;
  margin-top: 0.1rem;
}

.checkbox-terms .check-box {
  margin-top: 0.1rem;
}

/* Submit button */
.auth-submit {
  width: 100%;
  height: 3.1rem;
  margin-top: 0.35rem;
  position: relative;
}

.btn-spinner {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 999px;
  border: 2px solid oklch(1 0 0 / 40%);
  border-top-color: var(--primary-foreground);
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.form-msg {
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
  border-radius: 0.7rem;
  padding: 0.65rem 0.85rem;
}

.form-msg.is-success {
  background: oklch(0.5 0.1 158 / 12%);
  color: var(--success);
}

.form-msg.is-error {
  background: oklch(0.55 0.19 27 / 10%);
  color: var(--danger);
}

/* Divider + social */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 1.25rem;
  color: var(--muted-foreground);
  font-size: 0.78rem;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--glass-line);
}

.auth-social {
  width: 100%;
  height: 3rem;
}

.google-icon {
  width: 1.1rem;
  height: 1.1rem;
  stroke: none;
}

.auth-switch {
  margin-top: 1.5rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--muted-foreground);
}

.auth-switch button {
  color: var(--primary);
  font-weight: 800;
}

.auth-switch button:hover {
  text-decoration: underline;
}

.back-to-shop {
  margin-top: 1.75rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-foreground);
  transition: color 0.2s;
}

.back-to-shop svg {
  width: 1rem;
  height: 1rem;
  transform: scaleX(-1);
}

html[dir="rtl"] .back-to-shop svg {
  transform: none;
}

.back-to-shop:hover {
  color: var(--primary);
}

/* Shake animation for invalid submit */
@keyframes shake {

  10%,
  90% {
    transform: translateX(-1px);
  }

  20%,
  80% {
    transform: translateX(2px);
  }

  30%,
  50%,
  70% {
    transform: translateX(-4px);
  }

  40%,
  60% {
    transform: translateX(4px);
  }
}

.is-shaking {
  animation: shake 0.5s cubic-bezier(.36, .07, .19, .97) both;
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
.auth-links {display:flex; flex-wrap:wrap; gap:1rem; margin-top:1.5rem; font-size:.85rem; color:var(--primary)}
.auth-tab {text-align:center; flex:1}.auth-tab.is-active {background:var(--primary); border-radius:999px}
.input-wrap input {padding:0; width:100%; flex:1 1 0; min-width:0;}.input-toggle {font-size:.7rem;width:auto;padding:.25rem}
.field-hint ul {padding-inline-start:1rem}.field-hint {line-height:1.8}.form-msg {margin-block:1rem}
.input-wrap {border-color:var(--border)}
.auth-sub {margin: .5rem 0 1.25rem}

/* Stage 04: full-width fields with compact, non-overlapping controls. */
.field, .input-wrap {width:100%; min-width:0}
.input-wrap {padding-inline:.75rem; gap:.5rem}
.input-wrap input {padding:0; margin:0; color:var(--foreground); opacity:1}
.input-wrap input[type=email] {direction:ltr; text-align:left}
.input-toggle {flex:0 0 auto; padding:.25rem; width:auto; min-width:2.25rem}
.auth-submit, .auth-tab {border:1px solid var(--primary)}
.auth-tab {margin-inline:.15rem}
.auth-submit {width:100%; cursor:pointer}
.auth-submit:focus-visible, .auth-tab:focus-visible {outline:3px solid var(--primary); outline-offset:3px}
.password-match {flex:0 0 1.1rem; width:1.1rem; height:1.1rem; border-radius:50%; display:grid; place-items:center; font-family:Arial,sans-serif; font-size:.8rem; font-weight:bold}
.password-match.is-match {color:white; background:#237744}
.password-match.is-mismatch {color:white; background:#b42332}
.password-match-message {font-size:.8rem; margin-top:.5rem}
.password-match-message.is-match {color:#237744}
.password-match-message.is-mismatch {color:#b42332}
.input-wrap:has(.password-match.is-match) {border-color:#237744}
.input-wrap:has(.password-match.is-mismatch) {border-color:#b42332}

/* Stage 05: rounded glass buttons. */
.auth-submit {
  border-radius: 1.1rem;
  border: 1px solid rgba(157, 60, 55, .55);
  background: rgba(157, 60, 55, .09);
  color: var(--foreground);
  font-size: .95rem;
  font-weight: 700;
  overflow: hidden;
  isolation: isolate;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.65), 0 3px 10px rgba(70,35,25,.05);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color .3s ease, border-color .3s ease,
              box-shadow .3s ease, transform .3s ease;
}
.auth-submit::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 15%, rgba(255,255,255,.55) 48%, transparent 80%);
  transform: translateX(-110%);
  transition: transform .65s ease;
}
@media (hover: hover) and (pointer: fine) {
  .auth-submit:not(:disabled):hover {
    background-color: rgba(157,60,55,.16);
    border-color: rgba(157,60,55,.8);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.9), 0 8px 22px rgba(100,45,35,.14);
    transform: translateY(-2px);
  }
  .auth-submit:not(:disabled):hover::before {transform: translateX(110%)}
  .auth-tab:hover {background-color:rgba(157,60,55,.1)}
  .auth-tab.is-active:hover {background-color:var(--primary)}
}
.auth-tab {transition:background-color .3s ease, box-shadow .3s ease}
.auth-submit:not(:disabled):active {
  transform: translateY(0);
  background-color: rgba(157,60,55,.22);
  box-shadow: inset 0 2px 5px rgba(100,45,35,.12);
}
.auth-submit:disabled {opacity:.55; cursor:not-allowed}
@media (prefers-reduced-motion: reduce) {
  .auth-submit, .auth-submit::before, .auth-tab {transition:none}
  .auth-submit:not(:disabled):hover, .auth-submit:not(:disabled):active {transform:none}
  .auth-submit::before {display:none}
}
