/* ===================================================================
   طرح لبخند من — استایل روشن، سفید و آبی، ساده و مرتب
   فونت: ایران یکان (IRANYekanWeb) به‌صورت لوکال
   =================================================================== */

@font-face {
  font-family: 'IRANYekanWeb';
  src: url('../fonts/IRANYekanWebLight.woff2') format('woff2'),
       url('../fonts/IRANYekanWebLight.woff') format('woff');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANYekanWeb';
  src: url('../fonts/IRANYekanWebRegular.woff2') format('woff2'),
       url('../fonts/IRANYekanWebRegular.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANYekanWeb';
  src: url('../fonts/IRANYekanWebMedium.woff2') format('woff2'),
       url('../fonts/IRANYekanWebMedium.woff') format('woff');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'IRANYekanWeb';
  src: url('../fonts/IRANYekanWebBold.woff2') format('woff2'),
       url('../fonts/IRANYekanWebBold.woff') format('woff');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --ink: #1b2537;
  --ink-soft: #5c6b84;
  --ink-faint: #93a1b8;

  --bg: #eef4fc;
  --surface: #ffffff;
  --surface-alt: #f4f8fd;
  --border: #dfe9f6;
  --border-strong: #c7d8ee;

  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #e8f0ff;
  --primary-ink: #ffffff;

  --danger: #dc3545;
  --danger-soft: #fdecee;

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;

  --shadow-sm: 0 2px 8px rgba(31, 66, 135, 0.06);
  --shadow-md: 0 10px 26px rgba(31, 66, 135, 0.10);
  --shadow-lg: 0 16px 40px rgba(31, 66, 135, 0.12);

  --font-body: 'IRANYekanWeb', Tahoma, sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  direction: rtl;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font-family: inherit; }

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- هدر ---------- */
.site-header {
  padding: 40px 0 24px;
  text-align: center;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
}
.logo svg { color: var(--primary); flex-shrink: 0; }
.tagline {
  color: var(--ink-soft);
  margin: 10px 0 0;
  font-size: 15px;
  font-weight: 300;
  max-width: 30em;
  margin-inline: auto;
  line-height: 1.9;
}

/* ---------- کارت اصلی ---------- */
.main-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 40px;
  margin: 8px auto 60px;
  max-width: 900px;
}
@media (max-width: 640px) {
  .main-card { padding: 26px 20px; border-radius: var(--radius-md); }
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 44px;
  align-items: start;
}
@media (max-width: 760px) {
  .grid-2 { grid-template-columns: 1fr; gap: 34px; }
}

.step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 12px;
  font-weight: 700;
  margin-left: 8px;
}
.section-title {
  display: flex;
  align-items: center;
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--ink);
}
.hint {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.9;
  margin: 0 0 14px;
}

/* ---------- نمونه ---------- */
.sample-box {
  text-align: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.sample-photo {
  width: 100%;
  max-width: 200px;
  margin: 0 auto;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 3px solid var(--surface);
  outline: 1px solid var(--border-strong);
}
.sample-photo img { width: 100%; height: 100%; object-fit: cover; }
.sample-box .caption {
  font-size: 13px;
  color: var(--primary-strong);
  font-weight: 500;
  margin-top: 14px;
}
.rules {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13.5px;
  color: var(--ink);
  text-align: right;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rules li {
  padding-right: 24px;
  position: relative;
  line-height: 1.7;
}
.rules li::before {
  content: "";
  position: absolute;
  right: 2px;
  top: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary-soft);
  border: 2px solid var(--primary);
}

/* ---------- فرم ---------- */
label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--ink-soft);
}
.field { margin-bottom: 18px; }
input[type="text"],
input[type="tel"] {
  width: 100%;
  padding: 13px 15px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
input[type="tel"] { direction: ltr; text-align: right; }
input[type="text"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
input::placeholder { color: var(--ink-faint); }

.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 22px;
  text-align: center;
  cursor: pointer;
  background: var(--surface-alt);
  transition: border-color .15s, background .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}
.dropzone:hover { border-color: var(--primary); }
.dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .icon-wrap {
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
}
.dropzone .txt { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }
.dropzone .txt strong { color: var(--ink); font-weight: 500; }

.preview-wrap { margin-top: 16px; text-align: center; }
.preview-wrap img {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-sm);
  margin: 0 auto;
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.hidden { display: none !important; }

.error-box {
  background: var(--danger-soft);
  color: var(--danger);
  border-radius: var(--radius-sm);
  padding: 13px 16px;
  font-size: 13.5px;
  line-height: 1.85;
  margin-bottom: 16px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  padding: 15px 20px;
  border-radius: var(--radius-sm);
  border: none;
  background: var(--primary);
  color: var(--primary-ink);
  font-size: 15.5px;
  font-weight: 500;
  cursor: pointer;
  transition: transform .12s, box-shadow .12s, opacity .12s, background .15s;
  box-shadow: var(--shadow-sm);
  font-family: inherit;
}
.btn:hover { background: var(--primary-strong); box-shadow: var(--shadow-md); }
.btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }
.btn svg { flex-shrink: 0; }
.btn.secondary {
  background: var(--surface);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  box-shadow: none;
}
.btn.secondary:hover { border-color: var(--primary); color: var(--primary-strong); background: var(--primary-soft); }
.btn.small { width: auto; padding: 10px 16px; font-size: 13.5px; }

.credit-link { margin: -2px 0 16px; }

/* ---------- بخش لودینگ ---------- */
.loading-section {
  text-align: center;
  padding: 56px 10px 40px;
}
.scan-icon {
  width: 70px; height: 70px;
  margin: 0 auto 22px;
  border-radius: 50%;
  border: 5px solid var(--primary-soft);
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.check-icon {
  width: 70px; height: 70px;
  margin: 0 auto 22px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  animation: pop .3s ease;
}
@keyframes pop {
  0% { transform: scale(0.6); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
.loading-section .status {
  font-size: 15.5px;
  font-weight: 500;
  color: var(--ink);
}
.loading-section .sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* ---------- نتیجه ---------- */
.result-section { text-align: center; }
.compare-wrap {
  position: relative;
  max-width: 360px;
  margin: 0 auto 16px;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  aspect-ratio: 1 / 1;
  --pos: 50%;
  cursor: ew-resize;
  touch-action: none;
  direction: ltr;
}
.compare-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.compare-wrap .after-img {
  clip-path: inset(0 0 0 var(--pos));
}
.compare-wrap .divider {
  position: absolute;
  top: 0; bottom: 0;
  left: var(--pos);
  width: 2px;
  background: var(--surface);
  box-shadow: 0 0 8px rgba(0,0,0,.3);
}
.compare-wrap .handle {
  position: absolute;
  top: 50%;
  left: var(--pos);
  transform: translate(-50%, -50%);
  width: 38px; height: 38px;
  background: var(--surface);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  color: var(--primary-strong);
  cursor: ew-resize;
}
.compare-labels {
  display: flex;
  direction: ltr;
  justify-content: space-between;
  max-width: 360px;
  margin: 0 auto 24px;
  font-size: 12.5px;
  color: var(--ink-faint);
  font-weight: 500;
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.result-actions .btn { width: auto; min-width: 168px; }

/* ---------- شماره تماس / کد تایید ---------- */
.link-btn {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  color: var(--primary-strong);
  cursor: pointer;
  font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }
.link-btn:disabled {
  color: var(--ink-faint);
  cursor: not-allowed;
  text-decoration: none;
}
.otp-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}
.verified-phone-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  justify-content: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 26px;
  direction: rtl;
}
.verified-phone-row b { color: var(--ink); direction: ltr; display: inline-block; }

/* ---------- گالری طرح‌های قبلی ---------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 14px;
  margin-bottom: 8px;
}
.gallery-item {
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--surface-alt);
  text-decoration: none;
  display: block;
}
.gallery-item img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
}
.gallery-item .date {
  font-size: 11px;
  color: var(--ink-faint);
  text-align: center;
  padding: 6px 4px;
}

footer {
  text-align: center;
  color: var(--ink-faint);
  font-size: 12.5px;
  padding: 10px 0 50px;
}
