/* ==========================================================================
   Account page (/{lang}/account.html, /fr/compte.html...) — account.js
   Light page (same look as the Database): profile on the left, range packs
   and creator call on the right.
   ========================================================================== */
body.rc-account-page { background: #F4F0EA; }
.account-page {
  --ac-text: #0A0E1A;
  --ac-text-2: #475569;
  --ac-muted: #64748B;
  --ac-line: rgba(10, 14, 26, 0.08);
  --ac-navy: #3563c9;
  color: var(--ac-text);
}
.account-wrap { box-sizing: border-box; max-width: 1120px; margin: 0 auto; padding: 0 32px; }

/* Header (cream band under the navbar) */
.account-top,
.account-top.download-hero-beige {
  display: block;
  min-height: 0;
  padding: 112px 0 30px;
  text-align: start;
  border-bottom: 1px solid var(--ac-line);
}
.account-title { margin: 0; font-size: clamp(28px, 3vw, 38px); font-weight: 700; letter-spacing: -0.035em; line-height: 1.1; color: var(--ac-text); }
.account-subtitle { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: #5A657D; }

.account-shell { padding-top: 32px; padding-bottom: 96px; min-height: 46vh; }

.account-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.account-grid[hidden] { display: none; }
.account-side { display: grid; gap: 20px; }

.account-card {
  padding: 30px;
  border-radius: 20px;
  background: #FFFFFF;
  border: 1px solid var(--ac-line);
  box-shadow: 0 1px 2px rgba(10, 14, 26, 0.04), 0 8px 24px rgba(10, 14, 26, 0.04);
}
.account-card--center { max-width: 520px; margin: 0 auto; text-align: center; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Loading / logged out */
.account-loading { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 0; color: var(--ac-muted); font-size: 15px; }
.account-spinner {
  display: inline-block;
  width: 18px; height: 18px;
  border: 2px solid rgba(10, 14, 26, 0.12);
  border-top-color: var(--ac-navy);
  border-radius: 50%;
  animation: account-spin 0.8s linear infinite;
}
@keyframes account-spin { to { transform: rotate(360deg); } }
.account-out-logo { display: block; margin: 0 auto 16px; }
.account-out-title { margin: 0 0 8px; font-size: 22px; font-weight: 700; color: var(--ac-text); }
.account-out-text { margin: 0 auto 24px; max-width: 420px; font-size: 15px; line-height: 1.6; color: var(--ac-muted); }
.account-out-btn { justify-content: center; min-width: 200px; }

/* Profile header: avatar + name + email */
.account-head { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--ac-line); }
.account-avatar {
  width: 56px; height: 56px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 19px;
  font-weight: 700;
  color: #FFFFFF;
  background: linear-gradient(135deg, #3563c9, #1E3A6E);
}
.account-head-text { min-width: 0; }
.account-head-name { margin: 0; font-size: 20px; font-weight: 700; color: var(--ac-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-head-email { margin: 2px 0 0; font-size: 14px; color: var(--ac-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Fields */
.account-fields { display: flex; flex-direction: column; gap: 20px; }
.account-field { display: flex; flex-direction: column; gap: 8px; }
.account-label {
  font-family: var(--rc-font-mono, 'JetBrains Mono', monospace);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ac-muted);
}
.account-input {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1px solid rgba(10, 14, 26, 0.14);
  background: #FFFFFF;
  color: var(--ac-text);
  font: inherit;
  font-size: 15px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.account-input::placeholder { color: #94A3B8; }
.account-input:hover { border-color: rgba(10, 14, 26, 0.24); }
.account-input:focus, .account-input:focus-visible { outline: none; border-color: var(--ac-navy); box-shadow: 0 0 0 3px rgba(53, 99, 201, 0.15); }
.account-static { margin: 0; font-size: 15px; color: var(--ac-text); word-break: break-all; }

/* Country picker */
.account-country { position: relative; }
.account-country-btn { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; text-align: start; }
.account-country-value { display: inline-flex; align-items: center; gap: 10px; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.account-placeholder { color: #94A3B8; }
.account-chevron { flex-shrink: 0; color: var(--ac-muted); transition: transform 0.2s ease; }
.account-country-btn[aria-expanded="true"] .account-chevron { transform: rotate(180deg); }
.account-flag { width: 20px; height: 15px; border-radius: 3px; object-fit: cover; flex-shrink: 0; box-shadow: 0 0 0 1px rgba(10, 14, 26, 0.1); }
.account-country-panel {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline: 0;
  z-index: 30;
  padding: 8px;
  border-radius: 16px;
  background: #FFFFFF;
  border: 1px solid rgba(10, 14, 26, 0.12);
  box-shadow: 0 18px 44px rgba(10, 14, 26, 0.16);
}
.account-country-panel[hidden] { display: none; }
.account-country-search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: 6px; border-radius: 10px; color: var(--ac-muted); background: #F4F6FA; }
.account-country-search input { flex: 1; min-width: 0; border: 0; background: transparent; color: var(--ac-text); font: inherit; font-size: 14px; }
.account-country-search input:focus { outline: none; }
.account-country-list { list-style: none; margin: 0; padding: 0; max-height: 260px; overflow-y: auto; }
.account-country-list li { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; font-size: 14px; color: var(--ac-text); cursor: pointer; }
.account-country-list li:hover, .account-country-list li:focus { outline: none; background: #F1F5F9; }
.account-country-list li[aria-selected="true"] { background: rgba(53, 99, 201, 0.1); color: var(--ac-navy); font-weight: 600; }

/* Toggle */
.account-toggle { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.account-toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.account-toggle-track { position: relative; flex-shrink: 0; width: 44px; height: 24px; border-radius: 999px; background: #CBD5E1; transition: background-color 0.2s ease; }
.account-toggle-thumb { position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #FFFFFF; box-shadow: 0 1px 3px rgba(10, 14, 26, 0.25); transition: transform 0.2s ease; }
.account-toggle input:checked + .account-toggle-track { background: var(--ac-navy); }
.account-toggle input:checked + .account-toggle-track .account-toggle-thumb { transform: translateX(20px); }
[dir="rtl"] .account-toggle input:checked + .account-toggle-track .account-toggle-thumb { transform: translateX(-20px); }
[dir="rtl"] .account-toggle-thumb { left: auto; right: 3px; }
.account-toggle input:focus-visible + .account-toggle-track { outline: 2px solid var(--ac-navy); outline-offset: 2px; }
.account-toggle-text { font-size: 14.5px; line-height: 1.45; color: var(--ac-text-2); }

/* Actions */
.account-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--ac-line); }
.account-actions .rc-btn-primary { justify-content: center; }
.account-save[disabled] { opacity: 0.45; cursor: default; transform: none !important; box-shadow: none !important; }
.account-btn-light {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  color: var(--ac-text);
  background: #FFFFFF;
  border: 1px solid rgba(10, 14, 26, 0.16);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.account-btn-light:hover { background: #F1F5F9; }
.account-delete-btn {
  display: inline-flex;
  align-items: center;
  height: 46px;
  margin-inline-start: auto;
  padding: 0 18px;
  border-radius: 999px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #DC2626;
  background: transparent;
  border: 1px solid rgba(220, 38, 38, 0.35);
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.account-delete-btn:hover { background: rgba(220, 38, 38, 0.06); }

/* Side cards: range packs, creators */
.account-card-title { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; font-size: 18px; font-weight: 700; letter-spacing: -0.02em; color: var(--ac-text); }
.account-card-icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; color: var(--ac-navy); background: rgba(53, 99, 201, 0.1); }
.account-card-text { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--ac-muted); }
.account-ranges, .account-creator { padding: 24px; }
.account-ranges-list { display: grid; gap: 8px; margin: 0 0 16px; padding: 0; list-style: none; }
.account-range {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
  color: var(--ac-text) !important;
  border: 1px solid var(--ac-line);
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.account-range:hover { border-color: rgba(53, 99, 201, 0.35); background: #F8FAFD; }
.account-range img { flex-shrink: 0; width: 80px; height: 50px; border-radius: 8px; object-fit: cover; object-position: top left; background: #0B0F1E; }
.account-range span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.account-range b { font-size: 14px; font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-range small { font-size: 12.5px; color: var(--ac-muted); }
.account-ranges-empty { display: flex; justify-content: center; padding: 18px 12px; border-radius: 12px; font-size: 14px; color: var(--ac-muted); background: #F8FAFC; border: 1px dashed rgba(10, 14, 26, 0.14); }
.account-ranges-other { padding: 4px 4px 0; font-size: 13px; color: var(--ac-muted); }
.account-link { font-size: 14px; font-weight: 600; color: var(--ac-navy) !important; }
.account-link:hover { text-decoration: underline; }
.account-creator {
  color: #FFFFFF;
  background: radial-gradient(120% 140% at 100% 0%, rgba(59, 130, 246, 0.25) 0%, rgba(59, 130, 246, 0) 55%), linear-gradient(135deg, #142A61 0%, #0E1C44 60%, #0A1433 100%);
  border-color: rgba(10, 14, 26, 0.2);
}
.account-creator .account-card-title { color: #FFFFFF; }
.account-creator .account-card-icon { color: #93C5FD; background: rgba(147, 197, 253, 0.14); }
.account-creator .account-card-text { color: rgba(255, 255, 255, 0.75); }
.account-creator-btn { justify-content: center; }

/* Premium */
.account-premium { padding: 24px; }
.account-premium-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.account-premium-actions .rc-btn-primary { justify-content: center; }
.account-premium-actions { align-items: center; }
.account-premium-actions [hidden] { display: none !important; }
.account-link-btn { padding: 0 6px; border: 0; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--ac-muted); cursor: pointer; }
.account-link-btn:hover { color: var(--ac-text); text-decoration: underline; }
#rc-premium-cancel:hover { color: #DC2626; }
.account-seller { padding: 24px; }
.account-seller[hidden] { display: none; }

/* Delete modal (dark modal of modals.js) */
.account-delete-warning { color: #FCA5A5; font-weight: 700; margin: 8px 0 12px; }
.account-delete-list { margin: 0 0 14px; padding-inline-start: 20px; color: #CBD5E1; font-size: 14px; line-height: 1.7; }
/* Red in every state, darker on hover (also while disabled: e-mail not typed yet, "Deleting…"),
   without glow. .rc-btn-primary.account-delete-confirm beats the blue .rc-btn-primary:hover of styles.css. */
.rc-btn-primary.account-delete-confirm { background: #DC2626 !important; border-color: #DC2626 !important; box-shadow: none !important; }
.rc-btn-primary.account-delete-confirm:hover,
.rc-btn-primary.account-delete-confirm:focus-visible { background: #B91C1C !important; border-color: #B91C1C !important; box-shadow: none !important; }
.rc-btn-primary.account-delete-confirm:focus-visible { outline: 2px solid #FCA5A5; outline-offset: 2px; }
.rc-btn-primary.account-delete-confirm[disabled] { opacity: 0.45; cursor: not-allowed; }

@media (max-width: 900px) {
  .account-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .account-wrap { padding: 0 16px; }
  .account-top, .account-top.download-hero-beige { padding: 96px 0 22px; }
  .account-shell { padding-top: 20px; padding-bottom: 64px; }
  .account-card { padding: 22px 18px; }
  .account-actions > * { flex: 1 1 100%; justify-content: center; }
  .account-delete-btn { margin-inline-start: 0; }
  .account-head-name { font-size: 18px; }
}

/* Arabic: no letter spacing (it breaks the joined letters) */
[dir="rtl"] .account-label { letter-spacing: 0; text-transform: none; font-family: inherit; font-size: 13px; }

/* Creator panel: Creator Studio + new pack */
.account-seller-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 16px; }
.account-seller-actions .account-link { margin-top: 0; }
.account-studio-btn { justify-content: center; }

/* ---------- Range Craft Premium card ----------
   Subscribed: a normal card. Not subscribed, or subscription cancelled: the Premium look of the home page
   (mesh gradient, blue button) with the 3D crown in the corner. */
.account-card.account-premium { position: relative; }
.account-card.account-premium .account-premium-crown { display: none; }
.account-card.account-premium.is-promo {
  color: #FFFFFF;
  background-color: #191A37;
  background-image:
    radial-gradient(circle at 18% 18%, #3563c9 0%, transparent 60%),
    radial-gradient(circle at 88% 85%, #3563c9 0%, transparent 58%),
    radial-gradient(circle at 48% 58%, #101426 0%, #2E3B6D 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding-right: 120px;
}
.account-card.account-premium.is-promo .account-premium-crown {
  display: block; position: absolute; top: -26px; right: -14px; width: 120px; height: auto;
  transform: rotate(14deg); pointer-events: none; filter: drop-shadow(0 14px 22px rgba(0, 0, 0, 0.4));
}
.account-premium.is-promo .account-card-title { color: #FFFFFF; }
.account-premium.is-promo .account-card-text { color: rgba(255, 255, 255, 0.78); }
.account-premium.is-promo .account-card-icon { display: none; }
.account-premium.is-promo .rc-btn-primary { color: #FFFFFF !important; background: #3563c9 !important; border-color: transparent !important; }
.account-premium.is-promo .rc-btn-primary:hover { background: #2E57B3 !important; }
.account-premium.is-promo .account-btn-light { color: #FFFFFF; background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.24); }
.account-premium.is-promo .account-btn-light:hover { background: rgba(255, 255, 255, 0.16); }
.account-premium.is-promo .account-link-btn { color: rgba(255, 255, 255, 0.82); }
.account-premium.is-promo .account-link-btn:hover { color: #FFFFFF; }
@media (max-width: 640px) {
  .account-card.account-premium.is-promo { padding-right: 18px; }
  .account-card.account-premium.is-promo .account-premium-crown { width: 84px; top: -22px; right: -8px; }
}
/* E-mail field of the delete modal: no red glow from the browser while the address is incomplete (Firefox :invalid) */
#rc-delete-confirm:invalid, #rc-delete-confirm:user-invalid { box-shadow: none; outline: none; }
#rc-delete-confirm:-moz-ui-invalid { box-shadow: none; }
