/* ==========================================================================
   OliyFizika.uz 2.0 — Profil va Sozlamalar (dashboard/profile.html, dashboard/settings.html).
   Barcha qoidalar .of-acc ichida — boshqa sahifalarga ta'sir qilmaydi.
   ========================================================================== */

.of-acc { display: flex; flex-direction: column; gap: 18px; }
.of-acc [data-icon] { display: inline-flex; }
.of-acc-head h1 { font: 800 var(--of-text-2xl, 1.75rem)/1.2 var(--of-font-display); color: var(--of-text); }
.of-acc-head p { margin-top: 6px; }
.of-acc .of-alert[hidden] { display: none; }
.of-acc-retry { margin-left: auto; flex: none; }

.of-acc-link { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; font-weight: 700; font-size: var(--of-text-sm); color: var(--of-primary-text); }
.of-acc-link svg { width: 15px; height: 15px; }

/* ------------------------------------------------------------ Profil: bosh karta */
.of-acc-hero { display: flex; align-items: center; gap: 18px; padding: 22px; flex-wrap: wrap; }
.of-acc-avatar {
  display: grid; place-items: center; flex: none;
  width: 72px; height: 72px; border-radius: 50%;
  background: var(--of-primary-solid); color: #fff;
  font: 800 1.5rem/1 var(--of-font-display); letter-spacing: .02em;
}
.of-acc-avatar .of-skeleton { width: 72px; height: 72px; }
.of-acc-hero__text { flex: 1 1 220px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.of-acc-hero__text h2 { font: 750 var(--of-text-xl, 1.35rem)/1.25 var(--of-font-display); color: var(--of-text); overflow-wrap: anywhere; }
.of-acc-hero__text h2 .of-skeleton { width: 200px; max-width: 100%; }
.of-acc-hero__email { color: var(--of-text-2); font-size: var(--of-text-sm); overflow-wrap: anywhere; }
.of-acc-hero__email .of-skeleton { width: 160px; max-width: 100%; }
.of-acc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.of-acc-badges:empty { display: none; }
.of-acc-badges .of-badge { display: inline-flex; align-items: center; gap: 4px; }
.of-acc-badges .of-badge svg { width: 13px; height: 13px; }
.of-acc-hero__edit { min-height: 44px; }

/* ------------------------------------------------------------ Profil: kartalar */
.of-acc-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.of-acc-grid > :first-child { grid-row: span 2; }
.of-acc-card { display: flex; flex-direction: column; gap: 12px; padding: 20px; min-width: 0; }
.of-acc-card__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.of-acc-card__head h2 { font: 700 var(--of-text-lg)/1.3 var(--of-font-sans); color: var(--of-text); }
.of-acc-card__text { color: var(--of-text-2); font-size: var(--of-text-sm); line-height: 1.55; }
.of-acc-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.of-acc-actions .of-btn { min-height: 44px; }
.of-acc-actions [hidden] { display: none !important; }

.of-acc-dl { display: flex; flex-direction: column; margin: 0; }
.of-acc-dl > div { display: grid; grid-template-columns: minmax(120px, 38%) 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--of-border); align-items: baseline; }
.of-acc-dl > div:first-child { border-top: 0; padding-top: 2px; }
.of-acc-dl dt { color: var(--of-text-2); font-size: var(--of-text-sm); font-weight: 600; }
.of-acc-dl dd { margin: 0; color: var(--of-text); font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.of-acc-dl dd .of-skeleton { width: 70%; }

.of-acc-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.of-acc-stats li { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 12px 14px; border-radius: var(--of-radius-lg); background: var(--of-surface-sunken); min-width: 0; }
.of-acc-stats__icon { grid-row: span 2; display: grid !important; place-items: center; width: 40px; height: 40px; border-radius: 12px; }
.of-acc-stats__icon svg { width: 22px; height: 22px; }
.of-acc-stats__icon--orange { background: var(--of-warning-soft); color: var(--of-warning-text); }
.of-acc-stats__icon--purple { background: var(--of-special-soft); color: var(--of-special); }
.of-acc-stats__value { font: 800 1.3rem/1.15 var(--of-font-display); color: var(--of-text); min-height: 1.3em; }
.of-acc-stats__value .of-skeleton { width: 56px; height: 20px; }
.of-acc-stats__label { color: var(--of-text-2); font-size: var(--of-text-xs); font-weight: 600; }

/* ------------------------------------------------------------ Sozlamalar */
.of-acc-jump { display: flex; flex-wrap: wrap; gap: 8px; }
.of-acc-jump a {
  display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px;
  border: 1px solid var(--of-border); border-radius: var(--of-radius-pill); background: var(--of-surface);
  color: var(--of-text); font-weight: 600; font-size: var(--of-text-sm); text-decoration: none;
}
.of-acc-jump a:hover { border-color: var(--of-primary-soft-2, var(--of-primary)); color: var(--of-primary-text); }
.of-acc-jump svg { width: 16px; height: 16px; }

.of-acc-group { margin: 8px 0 -6px; color: var(--of-text-2); font: 800 var(--of-text-xs)/1.2 var(--of-font-sans); letter-spacing: .08em; text-transform: uppercase; }

.of-acc-section { display: flex; flex-direction: column; gap: 18px; padding: 22px; scroll-margin-top: calc(var(--of-header-h, 64px) + 16px); }
.of-acc-section:focus { outline: none; }
.of-acc-section:focus-visible { outline: 2px solid var(--of-primary); outline-offset: 3px; }
.of-acc-section__head { display: flex; align-items: flex-start; gap: 14px; }
.of-acc-section__head h2 { font: 700 var(--of-text-lg)/1.3 var(--of-font-sans); color: var(--of-text); }
.of-acc-section__head p { margin-top: 2px; font-size: var(--of-text-sm); }
.of-acc-section__icon { display: grid !important; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 12px; background: var(--of-primary-soft); color: var(--of-primary-text); }
.of-acc-section__icon svg { width: 22px; height: 22px; }
.of-acc-section__icon--danger { background: var(--of-danger-soft); color: var(--of-danger-text); }

.of-acc-form { display: flex; flex-direction: column; gap: 14px; max-width: 560px; }
.of-acc-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.of-acc-form .of-input[readonly] { background: var(--of-surface-sunken); color: var(--of-text-2); }
.of-acc-form .of-input:disabled { background: var(--of-surface-sunken); cursor: progress; }
.of-acc-form .of-field-error:empty { display: none; }
.of-acc-form__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; }
.of-acc-form__foot .of-btn { min-height: 44px; }
.of-acc-form__foot .of-btn svg { width: 18px; height: 18px; }
.of-acc .of-input-wrap .of-input-action { width: 44px; height: 44px; right: 0; }
.of-acc .of-input-wrap .of-input { padding-right: 50px; }
.of-acc-forgot { min-height: 44px; padding: 0 4px; font-weight: 600; color: var(--of-primary-text); }
.of-acc-forgot:disabled { color: var(--of-text-3); cursor: default; }
.of-acc .of-pw-match:empty { display: none; }
.of-acc .of-pw-rules li { color: var(--of-text-2); }
.of-acc .of-pw-rules li[data-ok="true"] { color: var(--of-success-text); }

.of-acc-note { max-width: 640px; }
.of-acc-note > div { display: flex; flex-direction: column; gap: 6px; }
.of-acc-note p { color: inherit; }
.of-acc-note .of-acc-link { min-height: 32px; align-self: flex-start; }

/* Mavzu tanlash */
.of-acc-theme { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; border: 0; max-width: 620px; min-width: 0; }
.of-acc-theme__opt { position: relative; display: block; cursor: pointer; min-width: 0; }
.of-acc-theme__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.of-acc-theme__card {
  display: flex; flex-direction: column; gap: 8px; padding: 10px;
  border: 2px solid var(--of-border); border-radius: var(--of-radius-lg); background: var(--of-surface);
  transition: border-color var(--of-dur-fast, .15s), box-shadow var(--of-dur-fast, .15s);
}
.of-acc-theme__opt:hover .of-acc-theme__card { border-color: var(--of-border-strong); }
.of-acc-theme__opt input:checked + .of-acc-theme__card { border-color: var(--of-primary); box-shadow: 0 0 0 3px var(--of-primary-soft); }
.of-acc-theme__opt input:focus-visible + .of-acc-theme__card { outline: 2px solid var(--of-primary); outline-offset: 3px; }
.of-acc-theme__preview { display: block; height: 58px; border-radius: 10px; border: 1px solid var(--of-border); }
.of-acc-theme__preview--light { background: linear-gradient(#e8eefc 0 14px, #fff 14px); }
.of-acc-theme__preview--dark { background: linear-gradient(#1c2740 0 14px, #0f1522 14px); }
.of-acc-theme__preview--system { background: linear-gradient(90deg, #fff 50%, #0f1522 50%); }
.of-acc-theme__label { display: flex; align-items: center; gap: 6px; min-height: 28px; font-weight: 650; font-size: var(--of-text-sm); color: var(--of-text); }
.of-acc-theme__label svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------ o'lchamlar */
@media (max-width: 900px) {
  .of-acc-grid { grid-template-columns: 1fr; }
  .of-acc-grid > :first-child { grid-row: auto; }
}
@media (max-width: 640px) {
  .of-acc { gap: 14px; }
  .of-acc-hero { padding: 18px; gap: 14px; }
  .of-acc-avatar { width: 58px; height: 58px; font-size: 1.2rem; }
  .of-acc-avatar .of-skeleton { width: 58px; height: 58px; }
  .of-acc-hero__edit { width: 100%; justify-content: center; }
  .of-acc-card, .of-acc-section { padding: 16px; }
  .of-acc-row { grid-template-columns: 1fr; }
  .of-acc-dl > div { grid-template-columns: 1fr; gap: 2px; }
  .of-acc-form__foot > .of-btn { width: 100%; justify-content: center; }
  .of-acc-actions .of-btn { flex: 1 1 100%; justify-content: center; }
  .of-acc-jump a { flex: 1 1 calc(50% - 4px); justify-content: center; }
}
@media (max-width: 420px) {
  .of-acc-theme { grid-template-columns: 1fr; }
  .of-acc-theme__card { flex-direction: row; align-items: center; }
  .of-acc-theme__preview { width: 64px; height: 40px; flex: none; }
  .of-acc-stats { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .of-acc-theme__card { transition: none; }
}
