/* ===== «حساب من» — آکاردئون داخل مودال ورود (js/account-panel.js) =====
   رنگ‌ها از متغیرهای --auth-* همان مودال (سرمه‌ای/طلایی) می‌آیند و در style.css تعریف شده‌اند. */

.auth-modal.auth-modal--account {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  padding: 40px 18px 22px;
  /* اسکرول روی خودِ مودال باعث می‌شد .auth-modal::before (کادر گرادیانی)
     همراه محتوا جابه‌جا شود و گوشه/خط پایینش از وسط فرم آدرس رد شود.
     اسکرول را به #authModalBody می‌دهیم تا ::before روی قاب ثابت بماند. */
  overflow: hidden;
  display: flex;
  flex-direction: column;
  overscroll-behavior: contain;
}
/* display:flex بالا ویژگی hidden مرورگر را خنثی می‌کرد؛ بعد از «خروج از حساب»
   مودال بسته‌شده (hidden=true) همچنان دیده می‌شد و دکمه «کار نمی‌کرد». */
.auth-modal.auth-modal--account[hidden] { display: none; }
.auth-modal.auth-modal--account .auth-brand,
.auth-modal.auth-modal--account .auth-divider {
  display: none;
}
.auth-modal.auth-modal--account #authModalBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.acct-head { display: flex; align-items: center; gap: 14px; padding: 2px 4px 16px; }
.acct-avatar {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--auth-navy-deep);
  color: var(--auth-gold-bright);
  font-size: 1.3rem;
  font-weight: 800;
  box-shadow:
    inset 3px 3px 8px rgba(0, 0, 0, 0.5),
    inset -3px -3px 8px rgba(255, 255, 255, 0.02),
    0 0 0 1.5px rgba(201, 161, 90, 0.55);
}
.acct-avatar-icon { width: 24px; height: 24px; }
.acct-head-text { min-width: 0; }
.acct-name { color: var(--auth-cream); font-size: 1.05rem; font-weight: 800; line-height: 1.5; overflow-wrap: anywhere; }
.acct-phone { color: var(--auth-muted); font-size: 0.85rem; direction: ltr; text-align: right; }

.acct-notice {
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--auth-navy-deep);
  color: var(--auth-gold-bright);
  font-size: 0.85rem;
  line-height: 1.8;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.3);
}

.acct-list { display: flex; flex-direction: column; gap: 8px; }
.acct-item {
  border-radius: 16px;
  background: var(--auth-navy-deep);
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.5), inset -3px -3px 8px rgba(255, 255, 255, 0.02);
  overflow: hidden;
}
.acct-item.is-open { box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.5), inset 3px 3px 8px rgba(0, 0, 0, 0.5); }

.acct-item-head {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  border: 0;
  background: none;
  color: var(--auth-cream);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: right;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.acct-item-head:hover .acct-item-title { color: var(--auth-gold-bright); }
.acct-item-icon { flex: none; width: 20px; height: 20px; color: var(--auth-gold); }
.acct-item-title { flex: 1; }
.acct-chevron { flex: none; width: 18px; height: 18px; color: var(--auth-muted); transition: transform 0.2s ease; }
.acct-item.is-open > .acct-item-head .acct-chevron { transform: rotate(180deg); color: var(--auth-gold-bright); }
.acct-count {
  min-width: 22px;
  padding: 0 7px;
  border-radius: 11px;
  background: rgba(201, 161, 90, 0.16);
  color: var(--auth-gold-bright);
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

.acct-item-body {
  padding: 14px 14px 16px;
  border-top: 1px solid rgba(201, 161, 90, 0.14);
  animation: acct-open 0.18s ease;
}
@keyframes acct-open { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.acct-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(201, 161, 90, 0.1);
}
.acct-row:last-of-type { border-bottom: 0; }
.acct-row-label { flex: none; color: var(--auth-muted); font-size: 0.83rem; }
.acct-row-value { min-width: 0; color: var(--auth-cream); font-weight: 700; font-size: 0.92rem; text-align: left; overflow-wrap: anywhere; }
.acct-row-value.is-ltr { direction: ltr; }

.acct-label { display: block; margin-bottom: 6px; color: var(--auth-muted); font-size: 0.83rem; }
.acct-hint { margin: 0 0 10px; color: var(--auth-muted); font-size: 0.83rem; line-height: 1.8; }
.acct-input {
  display: block;
  width: 100%;
  margin-bottom: 8px;
  padding: 11px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-navy);
  color: var(--auth-cream);
  font: inherit;
  font-size: 16px; /* زیر ۱۶px مرورگر iOS هنگام فوکوس زوم می‌کند */
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.45), inset -2px -2px 6px rgba(255, 255, 255, 0.02);
}
.acct-input::placeholder { color: var(--auth-muted); }
.acct-input:focus { outline: none; box-shadow: inset 2px 2px 6px rgba(0, 0, 0, 0.45), 0 0 0 1.5px var(--auth-gold); }
.acct-textarea { resize: none; overflow: hidden; line-height: 1.7; }

.acct-msg { min-height: 1em; margin: 0 0 6px; font-size: 0.82rem; }
.acct-msg.is-error { color: var(--auth-danger); }
.acct-msg.is-ok { color: #8fd0a4; }

.acct-btn-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.acct-btn {
  padding: 8px 14px;
  border: 1px solid rgba(201, 161, 90, 0.4);
  border-radius: 10px;
  background: none;
  color: var(--auth-gold-bright);
  font: inherit;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
}
.acct-btn:hover { background: rgba(201, 161, 90, 0.1); }
.acct-btn:disabled { opacity: 0.6; cursor: default; }
.acct-btn.is-primary { border-color: transparent; background: linear-gradient(145deg, var(--auth-gold-bright), var(--auth-gold)); color: var(--auth-navy-deep); }
.acct-btn.is-primary:hover { filter: brightness(1.06); }
.acct-btn.is-danger { border-color: rgba(224, 138, 149, 0.4); color: var(--auth-danger); }
.acct-btn.is-danger:hover { background: rgba(224, 138, 149, 0.1); }

.acct-card {
  margin-bottom: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--auth-navy);
  box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.12);
}
.acct-card.is-default { box-shadow: inset 0 0 0 1px rgba(201, 161, 90, 0.55); }
.acct-card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.acct-card-title { margin-bottom: 2px; color: var(--auth-cream); font-weight: 700; font-size: 0.9rem; line-height: 1.6; }
.acct-card-text { color: var(--auth-cream); font-size: 0.88rem; line-height: 1.8; overflow-wrap: anywhere; }
.acct-card-meta { color: var(--auth-muted); font-size: 0.78rem; }
.acct-card-price { margin-top: 4px; color: var(--auth-gold-bright); font-weight: 800; font-size: 0.85rem; }
.acct-card .acct-form .acct-input:last-of-type { margin-bottom: 4px; }

.acct-badge {
  display: inline-block;
  flex: none;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(201, 161, 90, 0.16);
  color: var(--auth-gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}
.acct-badge.is-default { margin-inline-start: 8px; }
.acct-badge.is-paid, .acct-badge.is-delivered { background: var(--auth-gold); color: var(--auth-navy-deep); }
.acct-badge.is-cancelled { background: rgba(224, 138, 149, 0.16); color: var(--auth-danger); }
.acct-empty { margin: 4px 0 12px; color: var(--auth-muted); font-size: 0.85rem; text-align: center; }

/* خروج از حساب: پایین و با فاصله‌ی واضح از بقیه تا اشتباهی زده نشود */
.acct-footer { margin-top: 26px; padding-top: 18px; border-top: 1px solid rgba(201, 161, 90, 0.18); }
.acct-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 16px;
  background: var(--auth-navy-deep);
  color: var(--auth-danger);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, 0.5), inset -3px -3px 8px rgba(255, 255, 255, 0.02);
}
.acct-logout .acct-item-icon { color: currentColor; }

@media (max-width: 420px) {
  .auth-modal.auth-modal--account { padding: 38px 12px 18px; }
  .acct-item-body { padding: 12px 12px 14px; }
}
