/* ============================================================
   FUSION PC — auth modal + account dashboard
   Reuses tokens from styles.css. RTL.
   ============================================================ */

/* ---------------- AUTH MODAL ---------------- */
.au-scrim {
  position: fixed; inset: 0; z-index: 180; background: rgba(13,15,19,.55);
  backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s;
}
.au-scrim.open { opacity: 1; visibility: visible; }
.au-modal {
  position: relative; width: 440px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto;
  background: #fff; border-radius: 22px; box-shadow: 0 40px 100px rgba(13,15,19,.45);
  transform: translateY(16px) scale(.97); transition: transform .3s cubic-bezier(.2,.9,.3,1.15);
  scrollbar-width: none;
}
.au-modal::-webkit-scrollbar { display: none; }
.au-scrim.open .au-modal { transform: none; }

.au-top { position: relative; padding: 26px 30px 0; text-align: center; }
.au-x {
  position: absolute; inset-block-start: 18px; inset-inline-end: 18px;
  width: 36px; height: 36px; border-radius: 10px; color: var(--slate); display: grid; place-items: center;
  transition: background .2s, color .2s;
}
.au-x:hover { background: var(--bg-soft); color: var(--ink); }
.au-x svg { width: 20px; height: 20px; }
.au-mark {
  width: 54px; height: 54px; border-radius: 15px; margin: 0 auto 14px; position: relative; overflow: hidden;
  background: linear-gradient(150deg, var(--ink), #20242e); display: grid; place-items: center;
}
.au-mark::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 30% 25%, var(--teal-glow), transparent 62%); }
.au-mark svg { position: relative; z-index: 2; width: 28px; height: 28px; color: var(--teal-bright); }
.au-top h2 { font-family: var(--font-disp); font-size: 23px; }
.au-top p { color: var(--slate); font-size: 14px; margin: 6px 0 0; }
.au-reason {
  margin: 16px 30px 0; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: #e9fbf7; color: var(--teal-deep); border: 1px solid rgba(0,214,189,.3);
  display: flex; align-items: center; gap: 9px;
}
.au-reason svg { width: 18px; height: 18px; flex: none; }

.au-body { padding: 22px 30px 30px; }

/* social */
.au-social { display: grid; gap: 10px; margin-bottom: 18px; }
.au-soc {
  display: flex; align-items: center; justify-content: center; gap: 11px;
  height: 50px; border-radius: 13px; border: 1.5px solid var(--line); background: #fff;
  font-family: var(--font-disp); font-weight: 600; font-size: 15px; color: var(--ink);
  transition: border-color .2s, background .2s, transform .15s;
}
.au-soc:hover { border-color: var(--ink); background: var(--bg-soft); }
.au-soc:active { transform: scale(.98); }
.au-soc svg { width: 20px; height: 20px; flex: none; }
.au-soc.apple svg { color: var(--ink); }

.au-or { display: flex; align-items: center; gap: 14px; color: var(--slate-2); font-size: 12.5px; font-weight: 600; margin: 4px 0 18px; }
.au-or::before, .au-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* fields */
.au-field { margin-bottom: 14px; }
.au-field label { display: block; font-family: var(--font-disp); font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 7px; }
.au-field input {
  width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--bg-soft);
  padding-inline: 15px; font-family: var(--font-body); font-size: 15px; color: var(--ink);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.au-field input::placeholder { color: var(--slate-2); }
.au-field input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(0,214,189,.1); }
.au-field input[dir="ltr"] { direction: ltr; text-align: start; }
.au-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.au-check { display: flex; align-items: flex-start; gap: 10px; margin: 4px 0 18px; cursor: pointer; }
.au-check input { width: 19px; height: 19px; margin-top: 1px; accent-color: var(--teal-deep); flex: none; cursor: pointer; }
.au-check span { font-size: 13px; color: var(--slate); line-height: 1.5; }

.au-err {
  display: none; margin-bottom: 14px; padding: 11px 14px; border-radius: 12px; font-size: 13.5px; font-weight: 600;
  background: rgba(255,92,57,.1); color: var(--warn); border: 1px solid rgba(255,92,57,.22);
}
.au-err.show { display: block; }

.au-submit { width: 100%; height: 52px; font-size: 16px; margin-top: 2px; }
.au-submit[disabled] { opacity: .6; pointer-events: none; }
.au-spin { width: 18px; height: 18px; border: 2.4px solid rgba(4,48,43,.3); border-top-color: #04302b; border-radius: 50%; animation: auSpin .7s linear infinite; }
@keyframes auSpin { to { transform: rotate(360deg); } }

.au-switch { text-align: center; margin-top: 18px; font-size: 14px; color: var(--slate); }
.au-switch button { font-family: var(--font-disp); font-weight: 700; color: var(--teal-deep); }
.au-switch button:hover { text-decoration: underline; }
.au-legal { text-align: center; font-size: 11.5px; color: var(--slate-2); margin-top: 16px; line-height: 1.6; }

/* register-only fields hidden in login mode */
.au-modal[data-mode="login"] .reg-only { display: none; }

/* ---------------- ACCOUNT PAGE ---------------- */
.acc-wrap { max-width: var(--maxw); margin: 0 auto; padding: 34px 28px 80px; }

/* gate (logged-out) */
.acc-gate { max-width: 440px; margin: 60px auto; text-align: center; background: #fff; border: 1px solid var(--line); border-radius: var(--r-xl); padding: 48px 40px; box-shadow: var(--sh-2); }
.acc-gate .au-mark { width: 60px; height: 60px; }
.acc-gate h1 { font-size: 26px; margin-bottom: 10px; }
.acc-gate p { color: var(--slate); margin: 0 0 26px; }

.acc-grid { display: grid; grid-template-columns: 280px 1fr; gap: 28px; align-items: start; }

/* sidebar */
.acc-side { position: sticky; top: 130px; display: flex; flex-direction: column; gap: 18px; }
.acc-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 22px; }
.acc-me { display: flex; align-items: center; gap: 14px; }
.acc-ava { width: 52px; height: 52px; border-radius: 14px; flex: none; display: grid; place-items: center; color: #04302b; font-family: var(--font-disp); font-weight: 800; font-size: 20px; background: radial-gradient(circle at 32% 28%, var(--teal-bright), var(--teal) 55%, #04786c); }
.acc-me .nm { font-family: var(--font-disp); font-weight: 700; font-size: 16px; line-height: 1.2; }
.acc-me .em { font-size: 12.5px; color: var(--slate); direction: ltr; text-align: start; margin-top: 3px; word-break: break-all; }
.acc-nav { padding: 8px; display: flex; flex-direction: column; gap: 2px; }
.acc-nav a {
  display: flex; align-items: center; gap: 13px; padding: 13px 14px; border-radius: 12px;
  font-family: var(--font-disp); font-weight: 600; font-size: 15px; color: var(--ink); cursor: pointer;
  transition: background .18s, color .18s;
}
.acc-nav a svg { width: 20px; height: 20px; color: var(--slate); transition: color .18s; }
.acc-nav a:hover { background: var(--bg-soft); }
.acc-nav a.on { background: var(--ink); color: #fff; }
.acc-nav a.on svg { color: var(--teal-bright); }
.acc-nav .sep { height: 1px; background: var(--line-2); margin: 6px 8px; }
.acc-nav a.danger { color: var(--warn); }
.acc-nav a.danger svg { color: var(--warn); }
.acc-nav a.danger:hover { background: rgba(255,92,57,.08); }

/* content panel */
.acc-panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 30px 32px; min-height: 440px; }
.acc-h { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.acc-h h2 { font-size: 22px; }
.acc-h p { color: var(--slate); font-size: 14px; margin: 4px 0 0; }
.acc-sec { display: none; }
.acc-sec.on { display: block; animation: accFade .3s ease; }
@keyframes accFade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* profile form */
.acc-form { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; max-width: 620px; }
.acc-form .full { grid-column: 1 / -1; }
.acc-form label { display: block; font-family: var(--font-disp); font-weight: 600; font-size: 13px; margin-bottom: 7px; }
.acc-form input { width: 100%; height: 48px; border: 1.5px solid var(--line); border-radius: 13px; background: var(--bg-soft); padding-inline: 15px; font-family: var(--font-body); font-size: 15px; color: var(--ink); transition: border-color .2s, background .2s, box-shadow .2s; }
.acc-form input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(0,214,189,.1); }
.acc-form input:disabled { color: var(--slate); cursor: not-allowed; }
.acc-form input[dir="ltr"] { direction: ltr; text-align: start; }
.acc-hint { font-size: 12px; color: var(--slate-2); margin-top: 6px; }
.acc-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 14px; margin-top: 6px; }
.acc-saved { color: var(--teal-deep); font-weight: 600; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; opacity: 0; transition: opacity .2s; }
.acc-saved.show { opacity: 1; }
.acc-saved svg { width: 17px; height: 17px; }

/* orders */
.order { border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; margin-bottom: 16px; transition: border-color .2s, box-shadow .2s; }
.order:hover { border-color: var(--teal); box-shadow: var(--sh-1); }
.order-top { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; padding-bottom: 14px; border-bottom: 1px solid var(--line-2); }
.order-no { font-family: var(--font-disp); font-weight: 800; font-size: 16px; direction: ltr; }
.order-date { font-size: 13px; color: var(--slate); }
.order-status { font-family: var(--font-disp); font-weight: 700; font-size: 12px; padding: 5px 12px; border-radius: 999px; background: rgba(0,214,189,.14); color: var(--teal-deep); }
.order-items { padding-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.order-line { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; }
.order-line .q { color: var(--slate); font-weight: 600; }
.order-line .nm { flex: 1; }
.order-line .pr { font-family: var(--font-disp); font-weight: 700; direction: ltr; }
.order-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.order-foot .tt { font-family: var(--font-disp); font-weight: 800; font-size: 18px; direction: ltr; }

/* addresses */
.addr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.addr { border: 1.5px solid var(--line); border-radius: var(--r); padding: 18px 20px; position: relative; }
.addr.def { border-color: var(--teal); }
.addr .def-tag { position: absolute; inset-block-start: 14px; inset-inline-end: 16px; font-family: var(--font-disp); font-weight: 700; font-size: 10.5px; color: var(--teal-deep); background: #e9fbf7; padding: 3px 9px; border-radius: 999px; letter-spacing: .04em; }
.addr h4 { font-family: var(--font-disp); font-size: 15.5px; margin-bottom: 6px; }
.addr p { font-size: 13.5px; color: var(--slate); margin: 2px 0; line-height: 1.5; }
.addr .addr-acts { display: flex; gap: 14px; margin-top: 14px; }
.addr .addr-acts button { font-family: var(--font-disp); font-weight: 600; font-size: 13px; color: var(--slate); transition: color .2s; }
.addr .addr-acts button:hover { color: var(--ink); }
.addr .addr-acts button.rm:hover { color: var(--warn); }
.addr .addr-acts button.mk { color: var(--teal-deep); }
.addr-add {
  border: 1.6px dashed var(--line); border-radius: var(--r); padding: 18px; display: flex; align-items: center;
  justify-content: center; gap: 9px; color: var(--slate); font-family: var(--font-disp); font-weight: 600; font-size: 14.5px;
  min-height: 120px; transition: border-color .2s, color .2s, background .2s;
}
.addr-add:hover { border-color: var(--teal); color: var(--teal-deep); background: #f3fdfb; }
.addr-add svg { width: 20px; height: 20px; }

/* addr form (inline panel) */
.addr-form { border: 1px solid var(--line); border-radius: var(--r); padding: 22px; margin-bottom: 18px; background: var(--bg-soft); }
.addr-form .grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.addr-form .grid .full { grid-column: 1 / -1; }
.addr-form label { display: block; font-family: var(--font-disp); font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.addr-form input { width: 100%; height: 44px; border: 1.5px solid var(--line); border-radius: 11px; background: #fff; padding-inline: 13px; font-family: var(--font-body); font-size: 14.5px; }
.addr-form input:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px rgba(0,214,189,.1); }
.addr-form .form-acts { display: flex; gap: 10px; margin-top: 16px; }

/* wishlist grid reuses .card; just a wrapper */
.wish-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* empty states */
.acc-empty { text-align: center; padding: 60px 20px; color: var(--slate); }
.acc-empty .ic { width: 64px; height: 64px; border-radius: 18px; background: var(--bg-soft); display: grid; place-items: center; margin: 0 auto 18px; color: var(--slate-2); }
.acc-empty .ic svg { width: 30px; height: 30px; }
.acc-empty h3 { font-family: var(--font-disp); font-size: 18px; color: var(--ink); margin-bottom: 8px; }
.acc-empty p { font-size: 14px; margin: 0 0 22px; }

@media (max-width: 980px) {
  .acc-grid { grid-template-columns: 1fr; }
  .acc-side { position: static; flex-direction: row; flex-wrap: wrap; }
  .acc-card { flex: 1; min-width: 240px; }
  .wish-grid { grid-template-columns: repeat(2, 1fr); }
  .addr-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .au-row2, .acc-form, .addr-form .grid { grid-template-columns: 1fr; }
  .wish-grid { grid-template-columns: 1fr; }
  .acc-panel { padding: 22px 18px; }
}

/* ---------------- CHECKOUT MODAL ---------------- */
.co-scrim { position: fixed; inset: 0; z-index: 190; background: rgba(13,15,19,.55); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.co-scrim.open { opacity: 1; visibility: visible; }
.co-modal { width: 470px; max-width: 100%; max-height: calc(100vh - 40px); overflow-y: auto; background: #fff; border-radius: 22px; box-shadow: 0 40px 100px rgba(13,15,19,.45); transform: translateY(16px) scale(.98); transition: transform .3s cubic-bezier(.2,.9,.3,1.15); scrollbar-width: thin; }
.co-scrim.open .co-modal { transform: none; }
.co-head { position: sticky; top: 0; background: #fff; display: flex; align-items: center; justify-content: space-between; padding: 20px 26px; border-bottom: 1px solid var(--line); z-index: 3; }
.co-head h2 { font-size: 20px; display: flex; align-items: center; gap: 9px; }
.co-head h2 svg { width: 21px; height: 21px; color: var(--teal-deep); }
.co-head .x { width: 36px; height: 36px; border-radius: 10px; color: var(--slate); display: grid; place-items: center; transition: background .2s; }
.co-head .x:hover { background: var(--bg-soft); color: var(--ink); }
.co-head .x svg { width: 20px; height: 20px; }
.co-body { padding: 22px 26px 6px; }
.co-sec { margin-bottom: 24px; }
.co-sec > h3 { font-family: var(--font-disp); font-size: 15px; margin-bottom: 13px; display: flex; align-items: center; gap: 9px; }
.co-sec > h3 .n { width: 23px; height: 23px; border-radius: 50%; background: var(--ink); color: #fff; display: grid; place-items: center; font-size: 12px; font-weight: 800; flex: none; }

/* address */
.addr-summary { border: 1.5px solid var(--teal); border-radius: 14px; padding: 15px 17px; background: #f3fdfb; }
.addr-summary .who { font-family: var(--font-disp); font-weight: 700; font-size: 14.5px; margin-bottom: 4px; }
.addr-summary .det { font-size: 13.5px; color: var(--slate); line-height: 1.6; }
.addr-summary .det .ph { direction: ltr; }
.addr-summary .change { margin-top: 11px; color: var(--teal-deep); font-family: var(--font-disp); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 5px; }
.addr-summary .change:hover { text-decoration: underline; }
.co-pick { display: grid; gap: 10px; }
.co-pick-item { display: flex; gap: 11px; align-items: flex-start; padding: 13px 15px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; transition: border-color .2s, background .2s; }
.co-pick-item.on { border-color: var(--teal); background: #f3fdfb; }
.co-pick-item input { margin-top: 2px; accent-color: var(--teal-deep); flex: none; }
.co-pick-item .who { font-family: var(--font-disp); font-weight: 600; font-size: 14px; }
.co-pick-item .det { font-size: 12.5px; color: var(--slate); margin-top: 2px; line-height: 1.5; }
.co-newbtn { display: inline-flex; align-items: center; gap: 7px; color: var(--teal-deep); font-family: var(--font-disp); font-weight: 700; font-size: 13.5px; margin-top: 4px; }
.co-newbtn svg { width: 16px; height: 16px; }
.co-newform { margin-top: 14px; }
.co-field { display: flex; flex-direction: column; }
.co-field label { font-family: var(--font-disp); font-weight: 600; font-size: 12.5px; margin-bottom: 6px; }
.co-field input { height: 46px; border: 1.5px solid var(--line); border-radius: 12px; padding-inline: 14px; font-family: var(--font-body); font-size: 14.5px; background: var(--bg-soft); transition: border-color .2s, background .2s, box-shadow .2s; }
.co-field input:focus { outline: none; border-color: var(--teal); background: #fff; box-shadow: 0 0 0 4px rgba(0,214,189,.1); }
.co-field input[dir="ltr"] { direction: ltr; text-align: start; }
.co-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.co-grid2 .full { grid-column: 1 / -1; }
.co-newform .save-addr { margin-top: 12px; }

/* payment */
.pay-opts { display: grid; gap: 10px; margin-bottom: 14px; }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid var(--line); border-radius: 13px; cursor: pointer; font-family: var(--font-disp); font-weight: 600; font-size: 15px; transition: border-color .2s, background .2s; }
.pay-opt.on { border-color: var(--teal); background: #f3fdfb; }
.pay-opt input { accent-color: var(--teal-deep); flex: none; }
.pay-opt .pm-ic { width: 38px; height: 26px; border-radius: 6px; display: grid; place-items: center; font-family: var(--font-disp); font-weight: 800; font-size: 11px; color: #fff; flex: none; letter-spacing: .02em; }
.pay-opt .pm-ic.card { background: linear-gradient(135deg, #1a2a6c, #2a6fdb); }
.pay-opt .pm-ic.bit { background: #0b8ac4; }
.pay-opt .pm-name { display: flex; flex-direction: column; line-height: 1.2; }
.pay-opt .pm-name small { font-weight: 500; font-size: 11.5px; color: var(--slate-2); margin-top: 2px; }
.pay-opt .check { margin-inline-start: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; }
.pay-opt.on .check { border-color: var(--teal); background: var(--teal); }
.pay-opt.on .check svg { width: 12px; height: 12px; color: #04302b; }
.pay-opt:not(.on) .check svg { display: none; }
.pay-fields { display: grid; gap: 12px; padding: 2px 2px 4px; }
.pay-note { display: flex; gap: 10px; align-items: flex-start; padding: 13px 15px; border-radius: 12px; background: var(--bg-soft); font-size: 13px; color: var(--slate); line-height: 1.55; }
.pay-note svg { width: 18px; height: 18px; color: var(--teal-deep); flex: none; margin-top: 1px; }

.co-foot { position: sticky; bottom: 0; background: #fff; padding: 18px 26px 24px; border-top: 1px solid var(--line); }
.co-sum { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 6px; }
.co-sum .ship { font-size: 13px; color: var(--teal-deep); font-weight: 600; }
.co-sum-total { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0 14px; }
.co-sum-total span { color: var(--slate); font-size: 14px; }
.co-sum-total b { font-family: var(--font-disp); font-weight: 800; font-size: 24px; direction: ltr; }
.co-err { color: var(--warn); font-size: 13.5px; font-weight: 600; margin-top: 12px; text-align: center; }
.co-err:empty { display: none; }

@media (max-width: 560px) {
  .co-grid2 { grid-template-columns: 1fr; }
}
