/* ==========================================================================
   AROQA Settings Feature Styles (Phase 4 Modular Isolation + Phase 12A Academic Control Center)
   Scoped to the Precise Academic Control Center (`section === 'settings'`)
   ========================================================================== */

.settings-control-page{
  display:grid;
  gap:16px;
  max-width:1460px;
  margin-inline:auto;
  color:#eef6fa;
  font-family:Alexandria,Inter,sans-serif;
}

.settings-page-heading{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  min-height:54px;
  padding:0 4px;
}

.settings-page-heading .card-kicker{color:#a8c6d5;font:500 .72rem Alexandria,Inter,sans-serif;letter-spacing:0}
.settings-page-heading h2{position:relative;display:inline-block;margin:5px 0 0;padding-bottom:13px;font:650 clamp(1.4rem,2vw,2rem)/1.4 Alexandria,Inter,sans-serif}
.settings-page-heading h2:after{content:"";position:absolute;inset-inline-start:0;bottom:0;width:54px;height:3px;border-radius:5px;background:#1dd0ef;box-shadow:0 0 10px #00c6ff85}
.settings-page-back{display:inline-flex;align-items:center;justify-content:center;gap:9px;flex:0 0 auto;min-height:38px;padding:7px 14px;border:1px solid #9bcde255;border-radius:9px;background:linear-gradient(145deg,#16394b,#0c2636);box-shadow:inset 0 1px #ffffff1b;color:#e3f4fb;font:500 .74rem Alexandria,Inter,sans-serif;cursor:pointer;transition:background .2s ease,border-color .2s ease}
.settings-page-back:hover,.settings-page-back:focus-visible{border-color:#75dcf2;background:#1b4960;outline:none}
.settings-page-back span{color:#6ce0f4;font-size:1.2rem;line-height:1}

.settings-layout{
  display:grid;
  grid-template-columns:280px minmax(0,1fr);
  gap:16px;
  align-items:start;
}

.settings-nav,
.settings-panel{
  padding:22px;
  border:1px solid rgba(175,219,238,.38);
  border-radius:15px;
  background:linear-gradient(155deg,#122b3bea,#0b1e2def 78%);
  box-shadow:inset 0 1px #ffffff24,0 13px 28px #0005;
}

.settings-nav{
  display:grid;
  gap:10px;
  align-content:start;
  position:sticky;
  top:18px;
}

.settings-nav-list{
  display:grid;
  gap:8px;
}

.settings-nav button{
  padding:11px 13px;
  border-radius:9px;
  text-align:inherit;
  background:rgba(30,65,83,.42);
  border:1px solid rgba(157,239,255,.19);
  color:var(--ui-text, #eefbff);
  font-weight:700;
  cursor:pointer;
  transition:background-color .16s ease, border-color .16s ease, color .16s ease;
}

.settings-nav button:hover{
  background:rgba(139,238,255,.07);
  border-color:rgba(139,238,255,.22);
  color:#ffffff;
}

.settings-nav button.active{
  background:linear-gradient(90deg, rgba(82,198,225,.26), rgba(38,116,149,.16));
  color:#f2fdff;
  border:1px solid rgba(139,238,255,.32);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.08);
}

.settings-nav-footer{
  margin-top:8px;
  padding-top:12px;
  border-top:1px solid rgba(148,163,184,.12);
}

.settings-nav .settings-back-profile-btn{
  width:100%;
  justify-content:center;
  text-align:center;
}

.settings-panel{
  display:grid;
  gap:18px;
}

.settings-account-head,
.settings-heading{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:20px;
}

.settings-account-copy{
  display:grid;
  gap:6px;
  min-width:0;
}

.settings-account-head h2{
  margin:2px 0 4px;
  font-size:1.75rem;
}

.settings-account-head p{
  margin:0;
  color:#b7d0dc;
  line-height:1.55;
}

.settings-identity-summary{
  display:flex;
  flex-wrap:wrap;
  align-items:center;
  gap:10px;
  margin-top:8px;
  padding:10px 14px;
  border-radius:12px;
  background:rgba(35,93,119,.18);
  border:1px solid rgba(154,211,232,.31);
}

.settings-identity-summary span{
  color:var(--text);
  font-size:.9rem;
}

.settings-identity-summary small{
  color:#abcbd9;
  font-size:.82rem;
}

.settings-account-aside{
  display:flex;
  flex-direction:column;
  align-items:flex-end;
  gap:10px;
  flex:0 0 auto;
}

.settings-account-links{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
}

.settings-avatar{
  width:64px;
  height:64px;
  border-radius:50%;
  border:1px solid rgba(121,220,241,.68);
  padding:4px;
  background:rgba(56,225,255,.13);
}

.settings-group{
  display:grid;
  gap:12px;
  padding-top:18px;
  border-top:1px solid rgba(154,211,232,.25);
  border-radius:14px;
  scroll-margin-top:116px;
  transition:border-color .18s ease, background-color .18s ease;
}

.settings-group:first-of-type{
  padding-top:0;
  border-top:none;
}

.settings-group:focus{
  outline:none;
}

.settings-group.is-focused-group{
  border-color:rgba(56,225,255,.22);
}

.settings-group-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}

.settings-group h4{
  margin:0;
  font-size:1rem;
}

.setting-state-pill{
  display:inline-flex;
  align-items:center;
  padding:4px 10px;
  border-radius:999px;
  background:rgba(56,225,255,.13);
  border:1px solid rgba(121,220,241,.38);
  color:#d1e9f1;
  font-size:.76rem;
  font-weight:700;
}

.lang-cards,
.language-cards{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
}

.lang-card{
  padding:18px;
  border-radius:10px;
  border:1px solid rgba(157,239,255,.3);
  background:rgba(30,65,83,.42);
  color:var(--ui-text, #eefbff);
  text-align:inherit;
  display:grid;
  gap:5px;
  cursor:pointer;
  transition:border-color .16s ease, background-color .16s ease;
}

.lang-card b{
  color:var(--ui-text, #eefbff);
  font-size:.98rem;
}

.lang-card.active{
  border-color:rgba(139,238,255,.75);
  background:rgba(77,190,218,.2);
}

.lang-card small{
  color:#b5d3df;
}

.settings-panel .link-btn,
.settings-panel .text-button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-height:36px;
  padding:6px 14px;
  border-radius:10px;
  border:1px solid rgba(139,238,255,.24);
  background:rgba(139,238,255,.08);
  color:var(--ui-cyan, #8beeff);
  font-weight:700;
  font-size:.82rem;
  cursor:pointer;
}

.settings-panel .link-btn:hover,
.settings-panel .text-button:hover{
  background:rgba(139,238,255,.15);
  border-color:rgba(139,238,255,.42);
}

.setting-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
  border-bottom:1px solid rgba(154,211,232,.2);
}

.setting-row:last-child{
  border-bottom:none;
}

.setting-row div{
  display:grid;
  gap:4px;
}

.setting-row small{
  color:#afcbd7;
  line-height:1.5;
}

.setting-control-cluster{
  display:flex !important;
  align-items:center;
  gap:12px;
  flex:0 0 auto;
}

.switch,
.setting-toggle{
  position:relative;
  width:52px;
  height:30px;
  display:inline-block;
  flex:0 0 auto;
}

.switch input{
  opacity:0;
  width:0;
  height:0;
}

.switch span{
  position:absolute;
  inset:0;
  border-radius:999px;
  background:rgba(255,255,255,.12);
  border:1px solid rgba(148,163,184,.18);
  transition:.18s ease;
}

.switch span:before{
  content:"";
  position:absolute;
  top:3px;
  left:4px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#fff;
  transition:.18s ease;
}

.switch input:checked + span{
  background:rgba(56,225,255,.28);
  border-color:rgba(56,225,255,.4);
}

.switch input:checked + span:before{
  transform:translateX(20px);
  background:var(--cyan);
}

.settings-actions{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  padding-top:8px;
}

.admin-preview-entry{
  padding:10px 16px;
  border-radius:12px;
  border:1px solid rgba(148,163,184,.18);
  background:rgba(255,255,255,.03);
  color:var(--muted-strong);
  font-weight:700;
  opacity:.82;
}

.admin-preview-entry:hover{
  background:rgba(255,255,255,.06);
  color:var(--text);
  opacity:1;
}

/* Reduced Motion Compliance */
.aroqa-reduced-motion .settings-control-page *,
.settings-control-page[data-reduced-motion="true"] *,
.aroqa-reduced-motion .switch span,
.aroqa-reduced-motion .switch span:before,
.settings-control-page[data-reduced-motion="true"] .switch span,
.settings-control-page[data-reduced-motion="true"] .switch span:before{
  transition:none !important;
  animation:none !important;
  scroll-behavior:auto !important;
}

@media (prefers-reduced-motion: reduce){
  .settings-control-page *,
  .switch span,
  .switch span:before{
    transition:none !important;
    animation:none !important;
    scroll-behavior:auto !important;
  }
}

/* Responsive Breakpoints */
@media(max-width:1050px){
  .settings-layout{
    grid-template-columns:1fr;
  }
  .settings-nav{
    position:static;
  }
}

@media(max-width:760px){
  .settings-control-page{gap:12px}
  .settings-page-heading{min-height:54px}
  .settings-page-back{font-size:.68rem;padding:6px 10px}
  .lang-cards{
    grid-template-columns:1fr;
  }
  .settings-account-head,
  .setting-row{
    flex-direction:column;
    align-items:flex-start;
  }
  .settings-account-aside{
    align-items:flex-start;
    width:100%;
  }
  .setting-control-cluster{
    width:100%;
    justify-content:space-between;
  }
}

@media(max-width:420px){
  .settings-page-heading{align-items:flex-start}
  .settings-page-back{margin-top:3px;max-width:144px;line-height:1.35}
  .settings-nav,
  .settings-panel{
    padding:16px;
  }
}
