﻿
.mftzf-auth-root,
.mftzf-auth-root * { box-sizing: border-box; }

.mftzf-auth-root {
  --mft-brand: var(--skin-color-brand, #6f258f);
  --mft-brand-strong: var(--skin-color-brand-strong, #55206d);
  --mft-brand-soft: var(--skin-color-brand-soft, #f5eef8);
  --mft-accent: var(--skin-color-accent, #f3c515);
  --mft-surface: var(--skin-color-surface, #fff);
  --mft-surface-muted: var(--skin-color-surface-muted, #faf8fb);
  --mft-text: var(--skin-color-text, #231f25);
  --mft-text-soft: var(--skin-color-text-soft, #756f79);
  --mft-border: var(--skin-color-border, #e7e0e9);
  --mft-danger: #b42318;
  --mft-danger-bg: #fff4f2;
  --mft-success: #067647;
  --mft-success-bg: #ecfdf3;
  --mft-info: #6941c6;
  --mft-info-bg: #f4f3ff;
  --mft-radius: var(--skin-radius-lg, 1.25rem);
  --mft-radius-sm: var(--skin-radius-md, .875rem);
  --mft-shadow: var(--skin-shadow-md, 0 16px 48px rgba(44, 30, 50, .09));
  --mft-shadow-sm: var(--skin-shadow-sm, 0 6px 20px rgba(44, 30, 50, .06));
  --mft-focus: var(--skin-focus, 0 0 0 3px rgba(111, 37, 143, .14));
  font-family: var(--skin-font-sans, IRANSans, Tahoma, sans-serif);
  color: var(--mft-text);
  direction: rtl;
}

.mft-auth-page {
  min-height: min(860px, 100vh);
  display: flex;
  align-items: center;
  padding: clamp(1rem, 4vw, 3rem);
  background:
    radial-gradient(circle at 88% 12%, color-mix(in srgb, var(--mft-brand) 8%, transparent), transparent 27rem),
    linear-gradient(180deg, var(--mft-surface-muted), #fff 80%);
}

.mft-auth-layout {
  width: min(68rem, 100%);
  margin-inline: auto;
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(22rem, 30rem);
  border: 1px solid var(--mft-border);
  border-radius: calc(var(--mft-radius) + .4rem);
  overflow: hidden;
  background: var(--mft-surface);
  box-shadow: var(--mft-shadow);
}

.mft-auth-brand {
  min-height: 38rem;
  padding: clamp(2rem, 4vw, 3.5rem);
  position: relative;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 15% 15%, rgba(255,255,255,.15), transparent 22rem),
    linear-gradient(145deg, var(--mft-brand-strong), var(--mft-brand));
}

.mft-auth-brand::after {
  content: "";
  position: absolute;
  width: 18rem;
  height: 18rem;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 50%;
  left: -7rem;
  bottom: -7rem;
}

.mft-auth-brand-badge {
  width: 3.75rem;
  height: 3.75rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.28);
  border-radius: 1rem;
  background: rgba(255,255,255,.11);
  backdrop-filter: blur(8px);
  font-weight: 900;
  letter-spacing: -.04em;
}

.mft-auth-brand-copy {
  position: absolute;
  inset-inline: clamp(2rem, 4vw, 3.5rem);
  inset-block-end: clamp(2.25rem, 5vw, 4rem);
  z-index: 1;
}

.mft-auth-brand-kicker {
  display: block;
  margin-bottom: .8rem;
  color: rgba(255,255,255,.72);
  font-size: .78rem;
  font-weight: 700;
}

.mft-auth-brand h1 {
  margin: 0 0 1rem;
  max-width: 32rem;
  color: #fff;
  font: inherit;
  font-size: clamp(1.9rem, 3.6vw, 3.15rem);
  font-weight: 900;
  line-height: 1.35;
}

.mft-auth-brand p {
  max-width: 31rem;
  margin: 0 0 1.5rem;
  color: rgba(255,255,255,.78);
  line-height: 2;
  font-size: .95rem;
}

.mft-auth-brand ul {
  display: flex;
  gap: .55rem;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

.mft-auth-brand li {
  padding: .55rem .75rem;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.9);
  font-size: .75rem;
}

.mft-auth-card {
  min-width: 0;
  min-height: 38rem;
  padding: clamp(1.5rem, 3.2vw, 2.5rem);
  background: var(--mft-surface);
  display: flex;
  flex-direction: column;
}

.mft-auth-topbar {
  min-height: 2.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.35rem;
}

.mft-auth-back {
  width: 2.5rem;
  height: 2.5rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--mft-border);
  border-radius: .8rem;
  background: var(--mft-surface);
  color: var(--mft-text);
  cursor: pointer;
  transition: .2s ease;
  transform: rotate(180deg);
}

.mft-auth-back:hover { border-color: var(--mft-brand); color: var(--mft-brand); }
.mft-auth-back.is-hidden { opacity: 0; pointer-events: none; }

.mft-auth-progress { display: flex; gap: .35rem; align-items: center; }
.mft-auth-progress span {
  width: .4rem;
  height: .4rem;
  border-radius: 999px;
  background: var(--mft-border);
  transition: .2s ease;
}
.mft-auth-progress span.is-active { width: 1.55rem; background: var(--mft-brand); }

.mft-auth-head { margin-bottom: 1.5rem; }
.mft-auth-eyebrow {
  margin-bottom: .45rem;
  color: var(--mft-brand);
  font-size: .74rem;
  font-weight: 800;
}
.mft-auth-head h2 {
  margin: 0;
  color: var(--mft-text);
  font: inherit;
  font-size: clamp(1.45rem, 2.5vw, 2rem);
  font-weight: 900;
  line-height: 1.5;
}
.mft-auth-head p {
  margin: .65rem 0 0;
  color: var(--mft-text-soft);
  font-size: .84rem;
  line-height: 1.9;
}

.mft-auth-alert {
  margin: 0 0 1rem;
  padding: .8rem .95rem;
  border: 1px solid;
  border-radius: var(--mft-radius-sm);
  font-size: .82rem;
  line-height: 1.8;
}
.mft-auth-alert.is-error { color: var(--mft-danger); border-color: #fecdca; background: var(--mft-danger-bg); }
.mft-auth-alert.is-success { color: var(--mft-success); border-color: #abefc6; background: var(--mft-success-bg); }
.mft-auth-alert.is-info { color: var(--mft-info); border-color: #d9d6fe; background: var(--mft-info-bg); }

.mft-auth-step {
  display: block;
  animation: mftAuthIn .18s ease;
}
@keyframes mftAuthIn {
  from { opacity: 0; transform: translateY(.3rem); }
  to { opacity: 1; transform: translateY(0); }
}

.mft-auth-field { margin-bottom: 1rem; }
.mft-auth-field label,
.mft-auth-section-title {
  display: block;
  margin-bottom: .45rem;
  font-size: .8rem;
  font-weight: 800;
}
.mft-auth-required { color: var(--mft-danger); }

.mft-auth-field input,
.mft-auth-field select,
.mft-auth-profile-grid input,
.mft-auth-profile-grid select,
.mft-auth-captcha input {
  width: 100%;
  min-height: 3.15rem;
  padding: 0 .95rem;
  border: 1px solid var(--mft-border);
  border-radius: .85rem;
  outline: 0;
  background: var(--mft-surface);
  color: var(--mft-text);
  font: inherit;
  font-size: .9rem;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.mft-auth-field input:focus,
.mft-auth-field select:focus,
.mft-auth-profile-grid input:focus,
.mft-auth-profile-grid select:focus,
.mft-auth-captcha input:focus {
  border-color: var(--mft-brand);
  box-shadow: var(--mft-focus);
}
.mft-auth-field input:disabled,
.mft-auth-field select:disabled { background: var(--mft-surface-muted); opacity: .78; }

.mft-auth-help {
  display: block;
  margin-top: .45rem;
  color: var(--mft-text-soft);
  font-size: .72rem;
  line-height: 1.7;
}

.mft-auth-input-wrap { position: relative; }
.mft-auth-input-wrap input { padding-inline-end: 4.5rem; }
.mft-auth-clear,
.mft-auth-password-toggle {
  position: absolute;
  inset-inline-end: .55rem;
  top: 50%;
  transform: translateY(-50%);
  min-width: 2rem;
  min-height: 2rem;
  padding: 0 .55rem;
  border: 0;
  border-radius: .65rem;
  background: var(--mft-surface-muted);
  color: var(--mft-text-soft);
  font: inherit;
  font-size: .74rem;
  cursor: pointer;
}

.mft-auth-primary {
  width: 100%;
  min-height: 3.15rem;
  border: 0;
  border-radius: .9rem;
  background: var(--mft-brand);
  color: #fff;
  font: inherit;
  font-size: .88rem;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--mft-brand) 22%, transparent);
  transition: .18s ease;
}
.mft-auth-primary:hover:not(:disabled) { background: var(--mft-brand-strong); transform: translateY(-1px); }
.mft-auth-primary:disabled { opacity: .62; cursor: wait; transform: none; }

.mft-auth-link {
  border: 0;
  padding: .25rem;
  background: transparent;
  color: var(--mft-brand);
  font: inherit;
  font-size: .77rem;
  font-weight: 800;
  cursor: pointer;
}
.mft-auth-link:disabled { opacity: .45; cursor: default; }
.mft-auth-center-link { display: block; margin: .85rem auto 0; }

.mft-auth-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .85rem;
  flex-wrap: wrap;
  margin-top: .8rem;
}

.mft-auth-choice-grid { display: grid; gap: .75rem; }
.mft-auth-choice {
  width: 100%;
  padding: 1rem;
  text-align: right;
  border: 1px solid var(--mft-border);
  border-radius: .95rem;
  background: var(--mft-surface);
  color: var(--mft-text);
  cursor: pointer;
  transition: .18s ease;
}
.mft-auth-choice:hover { border-color: var(--mft-brand); background: var(--mft-brand-soft); }
.mft-auth-choice strong { display: block; margin-bottom: .25rem; font-size: .88rem; }
.mft-auth-choice span { color: var(--mft-text-soft); font-size: .76rem; line-height: 1.7; }

.mft-auth-otp {
  position: relative;
  direction: ltr;
  display: flex;
  justify-content: center;
  gap: .45rem;
  margin: .25rem 0 1rem;
  cursor: text;
}
.mft-auth-otp-real {
  position: absolute;
  inset: 0;
  z-index: 2;
  /* Keep the native field detectable by Android OTP/autofill while visually hidden. */
  opacity: .01;
  width: 100%;
  height: 100%;
  color: transparent;
  background: transparent;
  border: 0;
  outline: 0;
  cursor: text;
}
.mft-auth-otp-box {
  width: min(3.1rem, 12vw);
  height: 3.35rem;
  display: grid;
  place-items: center;
  border: 1px solid var(--mft-border);
  border-radius: .8rem;
  background: var(--mft-surface);
  color: var(--mft-text);
  font-size: 1.2rem;
  font-weight: 900;
  transition: .18s ease;
}
.mft-auth-otp-box.is-filled { border-color: color-mix(in srgb, var(--mft-brand) 45%, var(--mft-border)); }
.mft-auth-otp-box.is-active { border-color: var(--mft-brand); box-shadow: var(--mft-focus); }

.mft-auth-code-tools {
  min-height: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .8rem;
  color: var(--mft-text-soft);
  font-size: .74rem;
}

.mft-auth-profile-grid {display: grid;gap: .85rem;margin-block-end: 1rem;}
.mft-auth-profile-grid .mft-auth-field { margin: 0; }

.mft-auth-roles { margin: 1rem 0; }
.mft-auth-role {
  display: flex;
  align-items: center;
  gap: .65rem;
  margin-top: .5rem;
  padding: .75rem;
  border: 1px solid var(--mft-border);
  border-radius: .8rem;
  cursor: pointer;
}
.mft-auth-role.is-selected { border-color: var(--mft-brand); background: var(--mft-brand-soft); }
.mft-auth-role input { accent-color: var(--mft-brand); }

.mft-auth-captcha {
  margin: .9rem 0 1rem;
  padding: .85rem;
  border: 1px solid var(--mft-border);
  border-radius: .9rem;
  background: var(--mft-surface-muted);
}
.mft-auth-captcha-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .65rem;
  font-size: .8rem;
}
.mft-auth-captcha-body {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: .65rem;
  align-items: center;
}
.mft-auth-captcha img {
  width: 7rem;
  height: 3rem;
  object-fit: contain;
  border: 1px solid var(--mft-border);
  border-radius: .65rem;
  background: #fff;
}

.mft-auth-social {
  margin-top: auto;
  padding-top: 1.4rem;
}
.mft-auth-social-title {
  position: relative;
  margin-bottom: .85rem;
  color: var(--mft-text-soft);
  text-align: center;
  font-size: .72rem;
}
.mft-auth-social-title::before,
.mft-auth-social-title::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 28%;
  height: 1px;
  background: var(--mft-border);
}
.mft-auth-social-title::before { right: 0; }
.mft-auth-social-title::after { left: 0; }
.mft-auth-social-controls { text-align: center; }

.mft-auth-payment {
  margin: auto 0;
  text-align: center;
}
.mft-auth-payment-icon {
  width: 4rem;
  height: 4rem;
  margin: 0 auto 1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 1.75rem;
  font-weight: 900;
}
.mft-auth-payment.is-success .mft-auth-payment-icon { background: var(--mft-success-bg); color: var(--mft-success); }
.mft-auth-payment.is-error .mft-auth-payment-icon { background: var(--mft-danger-bg); color: var(--mft-danger); }
.mft-auth-payment.is-pending .mft-auth-payment-icon { background: var(--mft-info-bg); color: var(--mft-info); }
.mft-auth-payment h2 { margin: 0 0 .6rem; font: inherit; font-size: 1.4rem; font-weight: 900; }
.mft-auth-payment p { margin: 0; color: var(--mft-text-soft); line-height: 1.9; font-size: .85rem; }
.mft-auth-reference {
  margin-top: 1rem;
  padding: .7rem;
  border-radius: .75rem;
  background: var(--mft-surface-muted);
  direction: ltr;
  font-size: .78rem;
}

.mft-auth-spinner {
  width: 1rem;
  height: 1rem;
  display: inline-block;
  border: 2px solid rgba(255,255,255,.45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: mftSpin .7s linear infinite;
}
@keyframes mftSpin { to { transform: rotate(360deg); } }

@media (max-width: 60rem) {
  .mft-auth-page { padding: 1rem; align-items: flex-start; }
  .mft-auth-layout {
    width: min(32rem, 100%);
    grid-template-columns: 1fr;
    margin-top: clamp(1rem, 7vh, 4rem);
  }
  .mft-auth-brand { display: none; }
  .mft-auth-card { min-height: auto; padding: 1.35rem; }
}

@media (max-width: 34rem) {
  .mft-auth-page { padding: .65rem; background: var(--mft-surface-muted); }
  .mft-auth-layout { margin-top: .5rem; border-radius: 1rem; }
  .mft-auth-card { padding: 1rem; }
  .mft-auth-head { margin-bottom: 1.1rem; }
  .mft-auth-head h2 { font-size: 1.35rem; }
  .mft-auth-captcha-body { grid-template-columns: 1fr; }
  .mft-auth-captcha img { width: 100%; height: 3.4rem; }
  .mft-auth-otp { gap: .3rem; }
  .mft-auth-otp-box { width: min(2.7rem, 13vw); height: 3rem; border-radius: .7rem; }
}


/* MFTZF account experience ---------------------------------------------------
   Authentication is intentionally presented as part of the Zafaraniyeh site,
   not as a product showcase. Existing Identity flows remain unchanged.
---------------------------------------------------------------------------- */
.mft-auth-page {
  min-height: 100dvh;
  padding: clamp(1rem, 4vw, 3rem);
  align-items: center;
  background:
    linear-gradient(180deg,
      color-mix(in srgb, var(--mft-brand-soft) 38%, #fff) 0,
      var(--mft-surface-muted) 22rem,
      #fff 100%);
}

.mft-auth-shell {
  width: min(34rem, 100%);
  margin-inline: auto;
}

.mft-auth-card {
  min-height: 0;
  width: 100%;
  padding: clamp(1.35rem, 3.5vw, 2.25rem);
  border: 1px solid var(--mft-border);
  border-radius: calc(var(--mft-radius) + .15rem);
  background: var(--mft-surface);
  box-shadow: var(--mft-shadow);
}

.mft-auth-site-brand {
  display: flex;
  align-items: center;
  gap: .8rem;
  padding-bottom: 1.15rem;
  margin-bottom: .9rem;
  border-bottom: 1px solid var(--mft-border);
}

.mft-auth-site-mark {
  width: 2.8rem;
  height: 2.8rem;
  flex: 0 0 2.8rem;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--mft-brand) 26%, var(--mft-border));
  border-radius: 50%;
  background: var(--mft-brand-soft);
  color: var(--mft-brand);
  font-size: 1.05rem;
  font-weight: 900;
}

.mft-auth-site-copy {
  min-width: 0;
  display: grid;
  gap: .12rem;
}

.mft-auth-site-copy strong {
  color: var(--mft-text);
  font-size: .92rem;
  font-weight: 900;
}

.mft-auth-site-copy span {
  color: var(--mft-text-soft);
  font-size: .74rem;
  font-weight: 600;
}

.mft-auth-topbar {
  min-height: 2.35rem;
  margin-bottom: 1.05rem;
}

.mft-auth-head {
  margin-bottom: 1.35rem;
}

.mft-auth-eyebrow {
  margin-bottom: .35rem;
  color: var(--mft-brand);
  font-size: .72rem;
  font-weight: 800;
}

.mft-auth-head h1 {
  margin: 0;
  color: var(--mft-text);
  font: inherit;
  font-size: clamp(1.4rem, 4vw, 1.75rem);
  font-weight: 900;
  line-height: 1.55;
}

.mft-auth-head p {
  max-width: 29rem;
  margin: .5rem 0 0;
  color: var(--mft-text-soft);
  font-size: .82rem;
  line-height: 1.9;
}

.mft-auth-primary {
  min-height: 3.15rem;
}

.mft-auth-choice-grid {
  gap: .65rem;
}

.mft-auth-choice {
  min-height: 4.4rem;
}

.mft-auth-privacy-note {
  margin: 1.15rem 0 0;
  padding-top: .9rem;
  border-top: 1px solid var(--mft-border);
  color: var(--mft-text-soft);
  text-align: center;
  font-size: .68rem;
  line-height: 1.8;
}

.mft-auth-otp {
  max-width: 25rem;
  margin-inline: auto;
}

.mft-auth-otp-real {
  font-size: 16px; /* Prevents iOS focus zoom and keeps OTP suggestion usable. */
  direction: ltr;
  text-align: center;
  caret-color: transparent;
}

.mft-auth-otp-box {
  width: min(3.25rem, 12vw);
  height: 3.35rem;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 60rem) {
  .mft-auth-page {
    padding: clamp(.75rem, 3vw, 1.25rem);
    align-items: center;
  }

  .mft-auth-shell {
    width: min(34rem, 100%);
    margin-top: 0;
  }

  .mft-auth-card {
    min-height: 0;
    padding: clamp(1.15rem, 4vw, 1.6rem);
  }
}

@media (max-width: 34rem) {
  .mft-auth-page {
    min-height: 100dvh;
    padding: .65rem;
    align-items: flex-start;
    background: var(--mft-surface-muted);
  }

  .mft-auth-shell {
    margin-top: max(.45rem, env(safe-area-inset-top));
  }

  .mft-auth-card {
    border-radius: 1rem;
    padding: 1rem;
    box-shadow: var(--mft-shadow-sm);
  }

  .mft-auth-site-brand {
    margin-bottom: .75rem;
    padding-bottom: .9rem;
  }

  .mft-auth-site-mark {
    width: 2.55rem;
    height: 2.55rem;
    flex-basis: 2.55rem;
  }

  .mft-auth-head {
    margin-bottom: 1.05rem;
  }

  .mft-auth-head h1 {
    font-size: 1.3rem;
  }

  .mft-auth-otp {
    gap: .28rem;
  }

  .mft-auth-otp-box {
    width: min(2.8rem, 13vw);
    height: 3rem;
    border-radius: .7rem;
  }

  .mft-auth-code-tools {
    align-items: flex-start;
  }

  .mft-auth-privacy-note {
    margin-top: .95rem;
  }
}

/* Corporate parity: richer role-registration cards */
.mft-auth-role-content {
  min-width: 0;
  flex: 1 1 auto;
  display: grid;
  gap: .25rem;
}
.mft-auth-role-content strong {
  color: var(--mft-text);
  font-size: .82rem;
  line-height: 1.7;
}
.mft-auth-role-description {
  color: var(--mft-text-soft);
  font-size: .7rem;
  line-height: 1.8;
}
.mft-auth-role-meta {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem .75rem;
  color: var(--mft-text-soft);
  font-size: .68rem;
}
.mft-auth-role-meta em {
  font-style: normal;
}
