/*
 FreeMedSite Academy — coherent desktop/tablet/mobile visual system.
 This is a final presentation layer over legacy CSS; no question or auth data changes.
*/
:root{--ui-ink:#142e46;--ui-muted:#64778b;--ui-navy:#0e2740;--ui-line:#e3eaf0;--ui-teal:#0d988a;--ui-bg:#f7f9fc;--ui-soft:#edf8f6;--ui-shadow:0 14px 42px rgba(15,42,68,.045)}
html{scroll-behavior:smooth}
body{font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ui-ink);background:var(--ui-bg)}
button,select,input{font-family:inherit}
button{transition:background-color .12s ease,border-color .12s ease,color .12s ease,transform .12s ease}
button:focus-visible,input:focus-visible,select:focus-visible{outline:3px solid #74b8ff;outline-offset:2px}
.container{width:min(1280px,calc(100% - 48px));margin-inline:auto}
header{position:sticky;top:0;z-index:45;background:rgba(255,255,255,.98);border-bottom:1px solid var(--ui-line);box-shadow:0 1px 8px rgba(15,39,64,.025);color:var(--ui-ink)}
header .topbar{display:flex;flex-direction:row;align-items:center;justify-content:space-between;min-height:76px;padding:10px 0;gap:20px;flex-wrap:nowrap}
header .brand{font-weight:800;letter-spacing:-.65px;font-size:1.22rem;line-height:1.1;white-space:nowrap}
header .brand::before{content:"+";display:inline-grid;place-items:center;background:var(--ui-teal);color:white;width:32px;height:32px;margin-right:9px;border-radius:10px;font-weight:800;font-size:1.3rem}
header .brand span{color:var(--ui-teal)}
header nav{display:flex;align-items:center;gap:4px;flex-wrap:nowrap;overflow:visible;width:auto;padding:0}
header nav button{border:0;white-space:nowrap;font-size:.88rem;font-weight:650;padding:10px 13px;border-radius:10px;color:#4d647a;background:transparent}
header nav button:hover{background:#eff5f8;color:#0c3453}
header nav button[aria-current="page"]{background:var(--ui-soft);color:#087a72}
header #accountNav{background:var(--ui-navy);color:#fff;padding-inline:17px;margin-left:7px}
header #accountNav[aria-current="page"]{background:var(--ui-teal);color:#fff}
#academyMenuButton{display:none;border:1px solid var(--ui-line);background:#fff;border-radius:10px;color:#193952;min-width:43px;height:43px;align-items:center;justify-content:center;font-size:1.35rem;cursor:pointer}
.hero{background:linear-gradient(118deg,#102d4b 0%,#143d5b 62%,#175766 100%);padding:37px 0 39px;color:#fff;border-radius:0}
.hero .container{padding:0}
.hero .eyebrow{color:#9de2d9;font-size:.7rem;letter-spacing:.13em;font-weight:750}
.hero h1{font-size:clamp(1.82rem,3.25vw,2.8rem);font-weight:800;line-height:1.12;letter-spacing:-.9px;margin:9px 0 12px;max-width:790px}
.hero p{font-size:.98rem;color:#d5e5ee;max-width:680px;line-height:1.6;margin:0}
.hero .herobuttons{display:flex;gap:10px;margin-top:22px;flex-wrap:wrap}
.btn,.hero .btn{font-weight:720;font-size:.89rem;min-height:41px;padding:10px 16px;border-radius:10px;background:var(--ui-teal);color:#fff}
.btn:hover{filter:none;background:#087c71}
.btn.white,.hero .btn.white{background:#fff;color:#173d5e}
.btn.white:hover{background:#eaf5f7}
.btn.secondary{background:#edf4f7;color:#23526a}
.btn.secondary:hover{background:#dcebf1}
.btn:disabled{opacity:.55;cursor:not-allowed}
body:not([data-ui-view="home"]) .hero{display:none}
.main{padding-top:30px;padding-bottom:72px}
.secttitle{margin:0 0 16px;gap:10px}
.secttitle h2{font-size:1.5rem;letter-spacing:-.4px;font-weight:770;line-height:1.3}
.secttitle>.muted{font-size:.85rem}
.section{animation:none}
.card,.panel{box-shadow:var(--ui-shadow);border:1px solid var(--ui-line);border-radius:16px;background:#fff}
#home .exam-finder{margin:0 0 20px;gap:12px}
#home .exam-finder input{font-size:.93rem;min-height:47px;background:#fff;border:1px solid #d5e2eb;border-radius:12px;box-shadow:0 2px 7px rgba(10,40,65,.025)}
#home .exam-finder-note{background:#eef6f8;border-radius:9px;color:#38586b;font-size:.79rem;padding:10px 13px;white-space:nowrap}
#catalogue{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px;align-items:stretch;margin-bottom:32px}
#catalogue .exam-list-card{position:relative;border:1px solid #e0e8f0;border-radius:16px;min-height:215px;background:#fff;display:flex;flex-direction:column;gap:0;padding:19px 18px 16px;box-shadow:var(--ui-shadow)}
#catalogue .exam-list-card:hover{border-color:#a9d9d2;transform:translateY(-2px);box-shadow:0 14px 27px rgba(12,49,80,.075)}
#catalogue .exam-list-card[hidden]{display:none!important}
#catalogue .exam-list-card .icon{font-size:1.38rem;line-height:1;display:inline-flex;align-items:center;justify-content:center;border-radius:11px;background:#eaf7f4;width:42px;height:42px;margin:0 0 16px}
#catalogue .exam-list-card h3{color:#183650;font-size:1.03rem;font-weight:760;line-height:1.35;margin:0 0 5px;letter-spacing:-.2px}
#catalogue .exam-list-card p{font-size:.81rem;line-height:1.45;color:#718397;min-height:0;margin:0 0 5px}
#catalogue .exam-list-card .portal-count{font-size:.73rem;font-weight:680;color:#138577;margin-top:1px;margin-bottom:12px}
#catalogue .exam-list-card button.btn{margin-top:auto;width:100%;min-height:37px;border-radius:9px;padding:8px;font-size:.82rem;background:#eef7f5;color:#09766f;font-weight:760}
#catalogue .exam-list-card button.btn:hover{background:#d9efe9}
#home>.secttitle:not(:first-child){margin-top:28px}
#home>.grid:not(#catalogue){grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#home>.grid:not(#catalogue) .card{padding:17px;min-height:auto}
#home>.grid:not(#catalogue) .card .icon{font-size:1.4rem}
#home>.grid:not(#catalogue) .card h3{font-size:.93rem;margin:8px 0 4px}
#home>.grid:not(#catalogue) .card p{font-size:.79rem;line-height:1.5;margin:0;min-height:auto}
#home .fms-featured{padding:21px;border:1px solid var(--ui-line);border-radius:17px;background:#fff;margin:18px 0 24px;box-shadow:var(--ui-shadow)}
#home .fms-featured-head h2{font-size:1.23rem;letter-spacing:-.25px}
#home .fms-featured-info{font-size:.84rem;margin:5px 0 14px}
#home .fms-featured-stem{font-size:1.02rem;margin:14px 0 10px;line-height:1.55}
#home .fms-featured-answers{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
#home .fms-featured-option{font-size:.86rem;line-height:1.45;min-height:53px;border:1px solid #dee8f0;background:#fbfcfe;padding:12px 13px;border-radius:10px}
#home .fms-featured-option:hover{background:#eef7f6}
#home .fms-featured-option.correct{background:#e6f7ed;border-color:#2aa572}
#home .fms-featured-option.wrong{background:#fff0ed;border-color:#c95454}
#home .fms-featured-actions{margin-top:14px}
#home .fms-featured-actions .btn{font-size:.79rem;min-height:36px}
#study .secttitle{margin:0 0 12px}
#study .bank-intro{background:var(--ui-soft);border:1px solid #d5ece7;border-radius:11px;padding:12px 16px;font-size:.87rem;line-height:1.55}
#study .bank-layout{display:grid;grid-template-columns:250px minmax(0,1fr);gap:16px;align-items:start}
#study .bank-side{border-radius:15px;border:1px solid var(--ui-line);padding:18px;background:#fff}
#study .bank-side label{margin-top:6px;display:block;font-size:.85rem}
#study .bank-side select{width:100%;min-height:40px;border-color:#d2e0e9;border-radius:9px;margin:7px 0 12px;background:#fff;color:#193650;font-size:.88rem}
#study .bank-filters{margin-top:6px;gap:8px}
#study .bank-filters button{padding:11px;border-radius:9px;font-size:.83rem;border:1px solid #dbe8ed}
#study .bank-filters button.active{background:#e2f6f1;color:#077469;border-color:#93d2c5}
#study .bank-legend{font-size:.76rem;color:#78889c;line-height:1.5;margin-top:15px}
#study #bankMain{padding:24px;border:1px solid var(--ui-line);border-radius:16px}
#study #bankTopic{font-size:.77rem;color:#0a8b7d}
#study #bankStem{font-weight:750;font-size:1.15rem;line-height:1.58;margin:16px 0 20px}
#study .bank-answer{background:#fff;border:1px solid #d8e4ed;border-radius:11px;padding:14px 15px;margin:9px 0;line-height:1.48}
#study .bank-answer:hover{background:#f7fafc;border-color:#c1d7e2}
#study .bank-answer .letter{background:#e9f1f5;color:#1c5365;border-radius:8px}
#study .bank-explanation{font-size:.9rem;line-height:1.65;border-radius:12px}
#study .bank-controls{display:flex;justify-content:space-between;border-top:1px solid #e8edf1;padding-top:17px}
#study .bank-lock{background:#f5faf9;border-color:#a6d9ce}
#exam .mock-builder{grid-template-columns:repeat(3,minmax(0,1fr));gap:15px;border-radius:16px;padding:22px}
#exam .exam-title h2{font-size:1.62rem}
#exam .mock-choice{font-size:.92rem;line-height:1.5;padding:13px}
#exam .mock-bar{background:#edf8f5}
#exam #mockPlaying{max-width:970px;margin-inline:auto}
#dashboard .metrics{grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin-bottom:18px}
#dashboard .metric{padding:20px}
#dashboard .metric strong{font-size:2rem}
#account .auth-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,0.65fr);gap:17px;max-width:1000px}
#account .auth-layout .panel{padding:23px;margin:0}
#account .auth-layout h3{margin:0 0 9px}
#account .cloud-note{display:none}
#account .auth-tabs{margin-bottom:10px}
#account .auth-tabs .btn{min-width:110px}
#account .auth-layout input,#account .auth-layout select{min-height:42px}
#account .pill{font-size:.74rem}
.academy-portal .portal-top h2{font-size:1.7rem}
.academy-portal .portal-top{padding-top:0}
.academy-portal .portal-actions{margin:14px 0}
.academy-portal .portal-controls{border:1px solid var(--ui-line);padding:17px}
.academy-portal .portal-group{border:1px solid var(--ui-line);border-radius:15px;box-shadow:var(--ui-shadow)}
.academy-portal .portal-topic-grid{grid-template-columns:repeat(3,minmax(0,1fr))}
.academy-portal .portal-topic{border:1px solid var(--ui-line);padding:14px;min-height:130px}
.academy-portal .portal-topic h4{font-size:.91rem}
.academy-portal .portal-topic .btn{font-size:.77rem;padding:7px 10px}
footer{padding:17px 0;background:#10273d;color:#bed1df;font-size:.78rem}
footer a{color:#fff}
@media(max-width:1160px){
  #catalogue{grid-template-columns:repeat(3,minmax(0,1fr))}
  header nav button{padding:9px 10px;font-size:.83rem}
  #home>.grid:not(#catalogue){grid-template-columns:repeat(2,minmax(0,1fr))}
  .academy-portal .portal-topic-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:960px){
  .container{width:calc(100% - 34px)}
  header .topbar{min-height:69px;flex-direction:row;align-items:center;justify-content:space-between;padding:10px 0}
  #academyMenuButton{display:inline-flex}
  header nav{display:none;position:absolute;right:17px;left:17px;top:calc(100% - 1px);background:#fff;box-shadow:0 16px 30px rgba(11,34,55,.14);padding:12px;border-radius:0 0 15px 15px;border:1px solid #dfe8ee;flex-direction:column;gap:5px;overflow:visible;width:auto;max-height:calc(100vh - 86px);overflow-y:auto}
  header nav[data-open="true"]{display:flex}
  header nav button{display:block;text-align:left;width:100%;padding:13px 14px;font-size:.92rem}
  header #accountNav{margin:5px 0 0;width:100%}
  #home .fms-featured-answers{grid-template-columns:1fr 1fr}
  #study .bank-layout{grid-template-columns:215px minmax(0,1fr)}
  #account .auth-layout{grid-template-columns:1fr}
}
@media(max-width:720px){
  .container{width:calc(100% - 30px)}
  .hero{padding:29px 0 31px}
  .hero h1{font-size:clamp(1.7rem,6vw,2.05rem)}
  .hero p{font-size:.9rem}
  .hero .herobuttons{gap:9px}
  .main{padding-top:22px}
  #catalogue{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
  #catalogue .exam-list-card{min-height:202px;padding:14px}
  #catalogue .exam-list-card .icon{width:38px;height:38px;margin-bottom:12px}
  #catalogue .exam-list-card h3{font-size:.93rem}
  #catalogue .exam-list-card .portal-count{font-size:.7rem}
  #home>.grid:not(#catalogue){grid-template-columns:repeat(2,minmax(0,1fr))}
  #home .exam-finder{display:block}
  #home .exam-finder-note{display:inline-block;margin-top:9px}
  #study .bank-layout{grid-template-columns:1fr}
  #study .bank-side{padding:12px;display:grid;grid-template-columns:1fr 1fr;gap:7px 12px;align-items:center}
  #study .bank-side>label,#study .bank-side>select{margin:0}
  #study .bank-side .bank-filters{grid-column:1/-1;display:grid;grid-template-columns:1fr 1fr;margin:5px 0}
  #study .bank-side .bank-legend{display:none}
  #study #bankMain{padding:16px}
  #study #bankStem{font-size:1.03rem;margin:14px 0}
  #exam .mock-builder{grid-template-columns:1fr 1fr;padding:15px}
  #exam .mock-builder label:first-child{grid-column:1/-1}
  .academy-portal .portal-topic-grid{grid-template-columns:1fr}
  .academy-portal .portal-controls{grid-template-columns:1fr}
  #dashboard .metrics{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:440px){
  #catalogue{grid-template-columns:1fr}
  #catalogue .exam-list-card{min-height:unset;display:grid;grid-template-columns:40px 1fr;gap:0 12px;padding:13px}
  #catalogue .exam-list-card .icon{grid-row:1/4;margin:0;align-self:start}
  #catalogue .exam-list-card h3{grid-column:2}
  #catalogue .exam-list-card p{grid-column:2}
  #catalogue .exam-list-card .portal-count{grid-column:2;margin-bottom:8px}
  #catalogue .exam-list-card button.btn{grid-column:2}
  #home .fms-featured-answers{grid-template-columns:1fr}
  #home>.grid:not(#catalogue){grid-template-columns:1fr}
  #exam .mock-builder{grid-template-columns:1fr}
  #exam .mock-builder label:first-child{grid-column:auto}
  #study .bank-side{display:block}
  #study .bank-side select{width:100%;margin:5px 0 13px}
  #study .bank-side .bank-filters{margin-top:5px}
  #dashboard .metrics{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
