/* =========================================
   ONE STEP — account.css
   لوحة حساب العميل
========================================= */

.account-page { background: var(--gray); min-height: calc(100vh - 64px); padding: 32px 0 64px; }

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

/* ===== SIDEBAR ===== */
.account-sidebar {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 24px;
  position: sticky;
  top: 88px;
}
.account-avatar {
  width: 72px; height: 72px;
  background: var(--navy);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  color: #fff;
}
.account-name { text-align: center; font-size: 17px; font-weight: 800; color: var(--navy); }
.account-phone { text-align: center; font-size: 15px; font-weight: 800; color: var(--navy); letter-spacing: 0.2px; margin-top: 2px; unicode-bidi: isolate; }
.account-phone:empty { display: none; }
.account-email { text-align: center; font-size: 13px; color: var(--muted); margin-bottom: 20px; overflow-wrap: anywhere; }
.account-phone + .account-email { margin-top: 2px; }

.account-nav { display: flex; flex-direction: column; gap: 4px; }
.account-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border-radius: 11px;
  font-size: 14px; font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.18s;
  border: none; background: none; font-family: inherit; text-align: right; width: 100%;
}
.account-nav-item:hover { background: var(--gray); color: var(--navy); }
.account-nav-item.active { background: var(--navy); color: #fff; }
.account-nav-item.logout { color: #c0392b; margin-top: 8px; }
.account-nav-item.logout:hover { background: #fdecec; }

/* ===== CONTENT ===== */
.account-content {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 32px;
}
.account-section-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 28px; flex-wrap: wrap; }
.account-section-title { font-size: 22px; font-weight: 800; color: var(--navy); margin-bottom: 6px; }
.account-section-sub { font-size: 14px; color: var(--muted); }
.btn-edit-profile {
  background: #fff; color: var(--navy);
  border: 1.5px solid var(--navy);
  border-radius: 12px;
  padding: 10px 20px; font-family: inherit;
  font-size: 13.5px; font-weight: 700; cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.btn-edit-profile:hover { background: var(--navy); color: #fff; }

/* Stat cards */
.account-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}
.stat-box {
  background: var(--gray);
  border-radius: 14px;
  padding: 20px;
  text-align: center;
}
.stat-box .sb-num { font-size: 28px; font-weight: 800; color: var(--navy); }
.stat-box .sb-label { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* Info rows */
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.info-item { display: flex; flex-direction: column; gap: 6px; }
.info-item.full { grid-column: 1 / -1; }
.info-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.info-value {
  font-size: 15px; font-weight: 600; color: var(--navy);
  background: var(--gray);
  border-radius: 11px;
  padding: 14px 16px;
}
.info-value.editable {
  border: 1.5px solid var(--border);
  background: #fff;
  outline: none;
  font-family: inherit;
  transition: all 0.2s;
}
.info-value.editable:focus { border-color: var(--green); box-shadow: 0 0 0 4px rgba(120,199,103,0.12); }
/* LTR values (the phone) hug the edge the label sits on, like the other fields */
.info-value[dir="ltr"] { text-align: right; }
/* 16px: below that iOS Safari zooms the page when an editable field takes focus */
.info-value.editable { font-size: 16px; }
.info-value.editable:disabled {
  border-color: transparent;
  background: var(--gray);
  color: var(--navy);
  cursor: default;
}

.account-actions { margin-top: 28px; display: flex; gap: 12px; }
.btn-save {
  /* Foreground on a filled-green surface: --on-green only.
     Value + full decision history live in css/style.css :root — never inline a
     literal here, a second literal is exactly how the two surfaces diverged. */
  background: var(--green); color: var(--on-green);
  border: none; border-radius: 12px;
  padding: 14px 28px; font-family: inherit;
  font-size: 15px; font-weight: var(--fw-medium); cursor: pointer;
  transition: all 0.2s;
}
.btn-save:hover { background: var(--green-d); }
.btn-cancel-edit {
  background: var(--gray); color: var(--text);
  border: 1.5px solid var(--border); border-radius: 12px;
  padding: 14px 28px; font-family: inherit;
  font-size: 15px; font-weight: 700; cursor: pointer;
  transition: all 0.2s;
}
.btn-cancel-edit:hover { background: var(--gray-2); }

.account-loading { text-align: center; padding: 80px 0; color: var(--muted); }

/* ===== أقسام الملف الشخصي (شخصية / موقع وتوصيل) ===== */
.info-block { margin-bottom: 26px; }
.info-block:last-of-type { margin-bottom: 0; }
.info-block-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: 0.2px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.info-readonly-tag {
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--gray-2);
  border-radius: 8px;
  padding: 1px 8px;
  margin-inline-start: 6px;
}
.info-value-flex { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gps-coords { font-weight: 700; color: var(--navy); }
.gps-link {
  font-size: 12px;
  font-weight: 700;
  /* --green-d on this 12%-tint background measures ~2.5:1 — fails AA
     (matches .cat-block-count/.locate-btn — same pattern, missed earlier). */
  color: var(--navy);
  text-decoration: none;
  background: rgba(120,199,103,0.12);
  border-radius: 8px;
  padding: 4px 10px;
}
.gps-link:hover { background: var(--green); color: var(--on-green); }

@media (max-width: 800px) {
  .account-layout { grid-template-columns: 1fr; }
  .account-sidebar { position: static; }
  .account-stats { grid-template-columns: 1fr; }
  .info-grid { grid-template-columns: 1fr; }
}

/* ===== تقليل الحركة — احترام prefers-reduced-motion (PRODUCT.md §الإتاحة) =====
   المستخدم الذي يطلب تقليل الحركة (نظام التشغيل) تصبح كل الانتقالات/الحركات
   لحظية فعلياً بدل إلغائها — لا تُفقد أي وظيفة، فقط تختفي الحركة. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ===== M26 · تأكيد رقم الهاتف عبر واتساب (js/account.js + OneStepCustomerAuth.mountCodeStep) ===== */
.phone-verify-btn {
  margin-top: 8px; min-height: 44px; padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--navy, #05173e);
  background: #fff; color: var(--navy, #05173e); font: inherit; font-weight: 700; cursor: pointer;
}
.phone-verify-btn:hover { background: #f1f4fa; }
.phone-verify-btn:focus-visible { outline: 3px solid #4f7cff; outline-offset: 2px; }
.phone-verify-btn[hidden], .phone-verify-host:empty { display: none; }
.phone-verify-host { margin-top: 12px; }
.phone-verify-host .code-step { display: flex; flex-direction: column; gap: 12px; }
.phone-verify-host .code-step[hidden] { display: none; }
.phone-verify-host .code-step-title { font-size: 14px; font-weight: 700; color: var(--navy, #05173e); line-height: 1.7; overflow-wrap: anywhere; }
.phone-verify-host .code-step-phone { font-weight: 800; unicode-bidi: isolate; }
.phone-verify-host .code-step-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; }
.phone-verify-host .code-step-link { background: none; border: none; padding: 8px 0; min-height: 44px; font: inherit; color: var(--navy, #05173e); text-decoration: underline; cursor: pointer; }
.phone-verify-host .code-step-link:disabled { color: #6b7280; cursor: not-allowed; text-decoration: none; }
.phone-verify-host input { width: 100%; min-height: 44px; font-size: 18px; letter-spacing: 6px; text-align: center; border: 1.5px solid #cfd6e4; border-radius: 10px; }
.phone-verify-host .input-wrap.error input { border-color: #c62828; }
.phone-verify-host .field-msg { color: #c62828; font-size: 13px; display: none; }
.phone-verify-host .field-msg.show { display: block; }
.phone-verify-host .auth-btn { min-height: 44px; border: none; border-radius: 10px; background: var(--navy, #05173e); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.phone-verify-host .auth-btn:disabled { opacity: .6; cursor: progress; }

/* ===== S11 · change password ===== */
.password-form .info-value.editable { cursor: text; }
.password-msg { margin: 12px 0 0; min-height: 1.4em; font-size: 14px; font-weight: 600; }
.password-msg.ok { color: #2e7d32; }
.password-msg.err { color: #c62828; }
.password-save { margin-top: 12px; display: inline-flex; }

/* S11.2.1 · delivery completion note (from checkout) + required marks */
.delivery-complete-note { margin: 0 0 14px; padding: 12px 14px; border-radius: 12px; background: rgba(120,199,103,0.14); border: 1.5px solid var(--green);
  color: var(--navy); font-weight: 700; font-size: 14px; line-height: 1.6; }
.info-label .req-star { color: #b42318; font-weight: 800; }
