/**
 * APNT Design System — CONTUL MEU (Biblie)
 * =========================================
 * Restilizarea modalului „Contul meu" din biblia.php pe designul aprobat
 * (design_handoff_apnt_unificare/Contul Meu.dc.html). Doar prezentare —
 * logica JS și id-urile funcționale rămân neatinse.
 *
 * Ordine de încărcare: DUPĂ styles.min.css + bible.min.css (suprascriem
 * .account-plan-card / .profile-theme-btn / etc. definite acolo).
 * Culorile vin EXCLUSIV din tokens.css (--apnt-*) — zero hex hardcodat.
 *
 * @author     Canny Agency SRL <office@canny.ro>
 * @copyright  2026 Canny Agency SRL
 * @link       https://www.canny.ro
 */

/* ── Overlay (mecanica existentă: JS comută style.display) ─────────────── */
.profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .45);
  z-index: var(--apnt-z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: apntProfileFadeIn .2s ease;
}
@keyframes apntProfileFadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ── Cardul modal — pe desktop găzduiește layout-ul pe 2 coloane din design ── */
.bible-profile-card {
  background: var(--apnt-bg);
  border: var(--apnt-border-width) solid var(--apnt-border-light);
  border-radius: var(--apnt-radius-lg);
  box-shadow: var(--apnt-shadow-xl);
  padding: 24px;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  font-family: var(--apnt-font-sans);
  color: var(--apnt-fg);
}
@media (min-width: 769px) {
  .bible-profile-card { animation: apntProfileScaleIn .2s ease; }
  @keyframes apntProfileScaleIn {
    from { opacity: 0; transform: scale(.95); }
    to { opacity: 1; transform: scale(1); }
  }
}
/* MOBILE: bottom sheet (comportament păstrat din implementarea veche) */
@media (max-width: 768px) {
  .profile-overlay { align-items: flex-end; padding: 0; }
  .bible-profile-card {
    border-radius: var(--apnt-radius-xl) var(--apnt-radius-xl) 0 0;
    max-width: 100%;
    max-height: 88vh;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    animation: apntProfileSlideUp .25s ease;
  }
  @keyframes apntProfileSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }
}

.profile-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--apnt-surface);
  border: var(--apnt-border-width) solid var(--apnt-border-light);
  font-size: 22px;
  cursor: pointer;
  color: var(--apnt-fg-muted);
  line-height: 1;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--apnt-radius-full);
  transition: background var(--apnt-transition-fast), color var(--apnt-transition-fast);
  z-index: 2;
  padding: 0;
}
.profile-close-btn:hover { background: var(--apnt-primary-soft); color: var(--apnt-primary); }
:root[data-theme="dark"] .profile-close-btn:hover { color: var(--apnt-primary-on-dark); }

/* ── Antet: eyebrow + salut (referință: „Biblia · Contul meu" / „Bună, cititorule!") ── */
.acct-head { margin: 0 0 20px; padding-right: 44px; }
.bible-profile-title {
  font: 800 1.375rem/1.2 var(--apnt-font-sans);
  letter-spacing: -.4px;
  color: var(--apnt-fg);
  margin: 8px 0 0;
  text-align: left;
}

/* ── Layout principal: 2 coloane pe desktop (1.15fr / .85fr ca în referință) ── */
.acct-main {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 24px;
  align-items: start;
}
.acct-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
@media (max-width: 900px) {
  .acct-main { grid-template-columns: 1fr; gap: 16px; }
  .acct-col { gap: 16px; }
}

/* Cardurile interioare (echivalent .card din components.css, definite aici
   pentru că components.css se încarcă în <body>, după acest fișier) */
.acct-card {
  background: var(--apnt-surface);
  border: var(--apnt-border-width) solid var(--apnt-border-light);
  border-radius: var(--apnt-radius-lg);
  box-shadow: var(--apnt-shadow-sm);
  padding: var(--apnt-space-lg);
  position: relative;
}
.acct-card-gold { overflow: hidden; }
.acct-card-gold::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--apnt-gold);
}
/* Header de card: eyebrow + actiune pe acelasi rand (ex. „+ Creează grup") */
.acct-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.acct-eyebrow {
  font: 700 .78rem/1.3 var(--apnt-font-sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--apnt-primary);
}
:root[data-theme="dark"] .acct-eyebrow { color: var(--apnt-primary-on-dark); }
.acct-hint { font: 400 .8125rem/1.5 var(--apnt-font-sans); color: var(--apnt-fg-muted); margin: 8px 0 0; }
.acct-count { font: 400 .75rem/1.4 var(--apnt-font-sans); color: var(--apnt-fg-muted); }

/* ── Codul personal — chip dashed auriu, mono (referință .codebox/.code) ── */
.bible-profile-card .profile-code-section { margin: 16px 0 0; padding: 0; background: none; border-radius: 0; }
.bible-profile-card .profile-code-display {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: flex-start;
  flex-wrap: wrap;
  background: var(--apnt-bg-warm);
  border: var(--apnt-border-width-2) dashed var(--apnt-gold);
  border-radius: var(--apnt-radius-md);
  padding: 16px 20px;
}
.bible-profile-card .profile-code-value {
  font: 700 clamp(1rem, 2.5vw, 1.5rem)/1.2 var(--apnt-font-mono);
  letter-spacing: .14em;
  color: var(--apnt-primary);
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
:root[data-theme="dark"] .bible-profile-card .profile-code-value { color: var(--apnt-primary-on-dark); }
.bible-profile-card .profile-code-copy {
  background: var(--apnt-surface);
  border: var(--apnt-border-width) solid var(--apnt-border);
  border-radius: var(--apnt-radius-sm);
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--apnt-fg-muted);
  flex: none;
  transition: border-color var(--apnt-transition-fast), color var(--apnt-transition-fast);
  padding: 0;
}
.bible-profile-card .profile-code-copy:hover { border-color: var(--apnt-primary); color: var(--apnt-primary); }
:root[data-theme="dark"] .bible-profile-card .profile-code-copy:hover { border-color: var(--apnt-primary-on-dark); color: var(--apnt-primary-on-dark); }

/* Acțiuni cod (fără cod încă): Generează / Am un cod */
.bible-profile-card .profile-code-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.bible-profile-card .profile-code-input { margin-top: 16px; }
.bible-profile-card .acct-field {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  background: var(--apnt-surface);
  color: var(--apnt-fg);
  border: var(--apnt-border-width-2) solid var(--apnt-border);
  border-radius: var(--apnt-radius-sm);
  font: 500 .9rem/1.4 var(--apnt-font-mono);
  letter-spacing: .08em;
  text-align: center;
}
.bible-profile-card .acct-field:focus {
  outline: none;
  border-color: var(--apnt-primary);
  box-shadow: 0 0 0 3px var(--apnt-primary-soft);
}

/* ── Butonul canonic în interiorul modalului ───────────────────────────────
   Definit local (scoped) pentru că components.css se încarcă abia în <body>;
   valorile = butonul canonic din components.css. */
.bible-profile-card .acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 10px 20px;
  border: var(--apnt-border-width-2) solid transparent;
  border-radius: var(--apnt-radius-sm);
  font: 600 .875rem/1.2 var(--apnt-font-sans);
  cursor: pointer;
  text-decoration: none;
  transition: background var(--apnt-transition-base), color var(--apnt-transition-base),
              border-color var(--apnt-transition-base), box-shadow var(--apnt-transition-base);
  background: none;
  color: var(--apnt-fg);
}
.bible-profile-card .acct-btn-sm { min-height: 36px; padding: 6px 14px; font-size: .8rem; }
.bible-profile-card .acct-btn-primary { background: var(--apnt-primary); border-color: var(--apnt-primary); color: var(--apnt-on-primary); box-shadow: var(--apnt-shadow-primary); }
.bible-profile-card .acct-btn-primary:hover { background: var(--apnt-primary-hover); border-color: var(--apnt-primary-hover); }
.bible-profile-card .acct-btn-secondary { background: var(--apnt-surface); border-color: var(--apnt-border); color: var(--apnt-fg); }
.bible-profile-card .acct-btn-secondary:hover { border-color: var(--apnt-primary); color: var(--apnt-primary); background: var(--apnt-primary-softer); }
:root[data-theme="dark"] .bible-profile-card .acct-btn-secondary:hover { border-color: var(--apnt-primary-on-dark); color: var(--apnt-primary-on-dark); }
.bible-profile-card .acct-btn-ghost { color: var(--apnt-primary); }
.bible-profile-card .acct-btn-ghost:hover { background: var(--apnt-primary-soft); }
:root[data-theme="dark"] .bible-profile-card .acct-btn-ghost { color: var(--apnt-primary-on-dark); }
.bible-profile-card .acct-btn-danger { background: var(--apnt-danger); border-color: var(--apnt-danger); color: #fff; }
.bible-profile-card .acct-btn-danger:hover { background: var(--apnt-danger-fg); border-color: var(--apnt-danger-fg); }
/* Starea „Activ" pe reminder (JS comută .active pe #profileBtnNotifications) */
.bible-profile-card .acct-btn.active { background: var(--apnt-success); border-color: var(--apnt-success); color: #fff; }

/* ── Plan activ (suprascrie .account-plan-card verde din bible.min.css) ── */
.bible-profile-card .account-plan-card {
  padding: 12px 14px;
  margin: 16px 0 0;
  background: var(--apnt-gold-soft);
  border: var(--apnt-border-width) solid var(--apnt-border-light);
  border-radius: var(--apnt-radius-md);
}
.bible-profile-card .account-plan-label {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--apnt-fg-muted);
}
.bible-profile-card .account-plan-title { font-size: .95rem; color: var(--apnt-primary); }
:root[data-theme="dark"] .bible-profile-card .account-plan-title { color: var(--apnt-primary-on-dark); }
.bible-profile-card .account-plan-meta { color: var(--apnt-fg-muted); }
.bible-profile-card .profile-progress-bar {
  height: 8px;
  background: var(--apnt-neutral-200);
  border-radius: var(--apnt-radius-pill);
  overflow: hidden;
}
:root[data-theme="dark"] .bible-profile-card .profile-progress-bar { background: var(--apnt-border); }
.bible-profile-card .profile-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--apnt-primary), var(--apnt-gold));
  border-radius: var(--apnt-radius-pill);
  transition: width .5s ease;
}
.bible-profile-card .profile-progress-text { font-size: .75rem; color: var(--apnt-fg-muted); margin-top: 4px; display: block; }

/* ── Statistici: 8 carduri (referință .statm/.statc/.statv/.statl) ─────── */
.bible-profile-card .bible-profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 16px 0 0;
}
.bible-profile-card .profile-stat {
  text-align: left;
  padding: 14px 16px;
  background: var(--apnt-bg-warm);
  border: none;
  border-radius: var(--apnt-radius-md);
}
.bible-profile-card .profile-stat-value {
  display: block;
  font: 800 1.5rem/1.2 var(--apnt-font-sans);
  color: var(--apnt-primary);
}
:root[data-theme="dark"] .bible-profile-card .profile-stat-value { color: var(--apnt-primary-on-dark); }
.bible-profile-card .profile-stat-label {
  display: block;
  font: 600 .68rem/1.4 var(--apnt-font-sans);
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--apnt-fg-muted);
  margin-top: 2px;
}
@media (max-width: 560px) {
  .bible-profile-card .bible-profile-stats { grid-template-columns: repeat(2, 1fr); gap: 8px; }
}

/* Meta cod (creat / ultima sincronizare) */
.bible-profile-card .account-meta-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--apnt-border);
  font-size: .7rem;
  color: var(--apnt-fg-muted);
}

/* ── Realizări (referință .ach — locked = grayscale) ───────────────────── */
.bible-profile-card .account-achievements-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.bible-profile-card .ach {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: 96px;
  text-align: center;
}
.bible-profile-card .ach-i {
  width: 64px;
  height: 64px;
  border-radius: var(--apnt-radius-full);
  background: var(--apnt-gold-soft);
  border: 2px solid var(--apnt-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.bible-profile-card .ach.off .ach-i {
  background: var(--apnt-bg-warm);
  border-color: var(--apnt-border);
  filter: grayscale(1);
  opacity: .55;
}
.bible-profile-card .ach-t { font: 600 .72rem/1.3 var(--apnt-font-sans); color: var(--apnt-fg-muted); }
@media (max-width: 560px) {
  .bible-profile-card .ach { width: 78px; }
  .bible-profile-card .ach-i { width: 52px; height: 52px; font-size: 1.25rem; }
}

/* ── Grupuri de citire (referință .grow + avatar inițiale) ─────────────── */
.bible-profile-card .account-groups-list { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.bible-profile-card .grow {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: var(--apnt-border-width) solid var(--apnt-border);
  border-radius: var(--apnt-radius-sm);
  background: var(--apnt-bg-warm);
}
.bible-profile-card .acct-avatar {
  width: 44px;
  height: 44px;
  border-radius: var(--apnt-radius-full);
  background: var(--apnt-primary-soft);
  color: var(--apnt-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: 700 .8rem/1 var(--apnt-font-sans);
  flex: none;
}
:root[data-theme="dark"] .bible-profile-card .acct-avatar { color: var(--apnt-primary-on-dark); }
.bible-profile-card .grow-name { font: 600 .875rem/1.3 var(--apnt-font-sans); color: var(--apnt-fg); }
.bible-profile-card .grow-meta { font: 400 .75rem/1.4 var(--apnt-font-sans); color: var(--apnt-fg-muted); }
.bible-profile-card .acct-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--apnt-radius-pill);
  font: 600 .72rem/1.2 var(--apnt-font-sans);
  background: var(--apnt-gold-soft);
  color: var(--apnt-gold-dark);
  flex: none;
}
:root[data-theme="dark"] .bible-profile-card .acct-badge { color: var(--apnt-gold); }

/* ── Rânduri de setări (referință .srow/.st/.sd) ───────────────────────── */
.bible-profile-card .srow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 0;
  border-bottom: var(--apnt-border-width) solid var(--apnt-border-light);
}
.bible-profile-card .srow:last-child { border-bottom: 0; padding-bottom: 0; }
.bible-profile-card .st { font: 600 .9rem/1.3 var(--apnt-font-sans); color: var(--apnt-fg); }
.bible-profile-card .sd { font: 400 .78rem/1.5 var(--apnt-font-sans); color: var(--apnt-fg-muted); margin: 2px 0 0; }
.bible-profile-card .srow-ctrl { display: flex; align-items: center; gap: 8px; flex: none; flex-wrap: wrap; justify-content: flex-end; }

/* A− / A+ — butoane rotunde tip .btn-icon din referință */
.bible-profile-card .profile-font-controls .profile-font-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: var(--apnt-radius-full);
  background: var(--apnt-surface);
  border: var(--apnt-border-width-2) solid var(--apnt-border);
  color: var(--apnt-fg-muted);
  font: 700 .85rem/1 var(--apnt-font-sans);
  cursor: pointer;
  transition: border-color var(--apnt-transition-fast), color var(--apnt-transition-fast), background var(--apnt-transition-fast);
}
.bible-profile-card .profile-font-controls .profile-font-btn:hover {
  background: var(--apnt-primary-soft);
  border-color: var(--apnt-primary);
  color: var(--apnt-primary);
}
:root[data-theme="dark"] .bible-profile-card .profile-font-controls .profile-font-btn:hover { color: var(--apnt-primary-on-dark); border-color: var(--apnt-primary-on-dark); }
.bible-profile-card .profile-font-controls .profile-font-btn:active { transform: scale(.95); }

/* Segmented control Temă: Zi / Noapte / Auto (referință .seg; JS comută .active) */
.bible-profile-card .seg {
  display: flex;
  border: var(--apnt-border-width-2) solid var(--apnt-border);
  border-radius: var(--apnt-radius-pill);
  overflow: hidden;
}
.bible-profile-card .seg .profile-theme-btn {
  border: 0;
  border-radius: 0;
  background: var(--apnt-surface);
  color: var(--apnt-fg-muted);
  font: 600 .8rem/1 var(--apnt-font-sans);
  padding: 10px 16px;
  min-height: 40px;
  cursor: pointer;
  transition: background var(--apnt-transition-fast), color var(--apnt-transition-fast);
}
.bible-profile-card .seg .profile-theme-btn:hover { color: var(--apnt-primary); background: var(--apnt-primary-softer); }
.bible-profile-card .seg .profile-theme-btn.active { background: var(--apnt-primary); color: var(--apnt-on-primary); }
@media (max-width: 560px) {
  .bible-profile-card .seg .profile-theme-btn { padding: 10px 12px; }
}

/* Reminder zilnic: input time + buton Activează/Activ */
.bible-profile-card .acct-time {
  min-height: 40px;
  padding: 6px 10px;
  border: var(--apnt-border-width) solid var(--apnt-border);
  border-radius: var(--apnt-radius-sm);
  background: var(--apnt-surface);
  color: var(--apnt-fg);
  font: 600 .8125rem/1.2 var(--apnt-font-sans);
}
.bible-profile-card .acct-time:focus {
  outline: none;
  border-color: var(--apnt-primary);
  box-shadow: 0 0 0 3px var(--apnt-primary-soft);
}

/* ── Alert info (referință .alert-info) — definit local, scoped ────────── */
.bible-profile-card .acct-alert {
  display: block;
  padding: 14px 16px;
  border-radius: var(--apnt-radius-md);
  border: var(--apnt-border-width) solid var(--apnt-info);
  background: var(--apnt-info-bg);
  color: var(--apnt-info-fg);
  font: 500 .8125rem/1.5 var(--apnt-font-sans);
}
