/* AMISA 51 — polished and accessible RTL custom presentation for academic selects.
   Native <select> remains in the DOM as the source of truth. */
.am51-select { position: relative; width: 100%; min-width: 0; direction: rtl; isolation: isolate; }
.am51-native {
  position: absolute !important; inset-inline-start: 0 !important; top: 0 !important;
  width: 1px !important; height: 1px !important; padding: 0 !important;
  border: 0 !important; opacity: 0 !important; pointer-events: none !important;
  clip: rect(0,0,0,0) !important; clip-path: inset(50%) !important;
  overflow: hidden !important; appearance: none !important;
}
.am51-trigger {
  appearance: none; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 58px; padding: 9px 13px 9px 15px;
  border: 1px solid rgba(90,172,187,.35); border-radius: 16px;
  background: linear-gradient(135deg,#173448 0%, #102737 78%,#142f41 100%);
  color: #f0faff; box-shadow: inset 0 1px 0 rgba(255,255,255,.065),0 6px 18px rgba(0,6,15,.09);
  cursor: pointer; text-align: right; font: inherit; font-size: 14px; font-weight: 750;
  transition: border-color .19s ease,box-shadow .19s ease,transform .19s ease,background .19s ease;
}
.am51-trigger:hover { border-color: rgba(52,224,206,.8); background: linear-gradient(135deg,#1c4153,#122d3f); transform: translateY(-1px); }
.am51-trigger[aria-expanded="true"] { border-color: #41ddcc; box-shadow:0 0 0 3px rgba(40,209,194,.13),0 12px 30px rgba(0,13,28,.24); }
.am51-trigger:focus-visible { outline: 3px solid #4ae5cf !important; outline-offset: 3px !important; }
.am51-trigger:disabled { cursor:not-allowed; opacity:.53; transform:none; }
.am51-glyph { display:grid; place-items:center; width:38px; height:38px; flex:none; border-radius:11px; background:rgba(32,206,190,.13); color:#75eddd; border:1px solid rgba(56,219,201,.2); }
.am51-glyph svg,.am51-arrow svg { width:19px; height:19px; display:block; fill:none; stroke:currentColor; stroke-width:1.9; stroke-linecap:round; stroke-linejoin:round; }
.am51-trigger-text { min-width:0; flex:1; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; line-height:1.75; }
.am51-trigger-text.is-placeholder { color:#a9c7d2; font-weight:650; }
.am51-arrow { display:grid; place-items:center; width:25px; height:30px; flex:none; color:#a6cbd7; transition:transform .19s ease; }
.am51-trigger[aria-expanded="true"] .am51-arrow{ transform:rotate(180deg); color:#72e9d8; }
.am51-popup {
  position:fixed; z-index:2147483000; box-sizing:border-box; overflow:hidden;
  direction:rtl; border:1px solid rgba(72,184,185,.44); border-radius:18px;
  background:linear-gradient(155deg,#132d3e 0%,#0b1e2c 92%); color:#effaff;
  box-shadow:0 25px 70px rgba(0,9,19,.42),0 6px 18px rgba(0,13,24,.24),inset 0 1px 0 rgba(255,255,255,.07);
  padding:8px; animation:am51-pop .17s cubic-bezier(.2,.8,.3,1) both;
  font-family:'Cairo','Noto Kufi Arabic','Noto Sans Arabic',Tahoma,Arial,sans-serif;
}
@keyframes am51-pop {from{opacity:0;transform:translateY(-5px) scale(.985)}to{opacity:1;transform:translateY(0) scale(1)}}
.am51-popup-head{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:9px 12px 11px;margin-bottom:4px;border-bottom:1px solid rgba(173,228,239,.11);}
.am51-popup-head strong{font-size:12px;color:#cde9ee;font-weight:800;}
.am51-popup-head small{font-size:10px;color:#70c9c8;}
.am51-popup-options{max-height:inherit;overflow-y:auto;scrollbar-color:#376c75 transparent;scrollbar-width:thin;overscroll-behavior:contain;}
.am51-option{
  display:flex;align-items:center;gap:10px;width:100%;min-height:52px;
  border:1px solid transparent;border-radius:11px;padding:10px 12px;
  background:transparent;color:#d7e9f0;font-family:inherit;font-size:13px;
  font-weight:700;text-align:right;line-height:1.65;cursor:pointer;
  transition:background .16s ease,border-color .16s ease,color .16s ease;
}
.am51-option + .am51-option{margin-top:3px;}
.am51-option:hover,.am51-option:focus-visible{background:rgba(81,164,187,.15);border-color:rgba(110,213,215,.28);color:#fff;outline:none;}
.am51-option[aria-selected="true"]{color:#8ef2e1;background:linear-gradient(100deg,rgba(22,185,167,.19),rgba(22,185,167,.06));border-color:rgba(40,210,191,.39);}
.am51-option:disabled{opacity:.4;cursor:not-allowed;}
.am51-option-dot{width:8px;height:8px;border-radius:99px;flex:none;border:1px solid #638fa0;background:#173748;}
.am51-option[aria-selected="true"] .am51-option-dot{background:#39dfc7;border-color:#39dfc7;box-shadow:0 0 0 4px rgba(32,213,194,.12);}
.am51-option-label{flex:1;min-width:0;}
.am51-check{width:21px;height:21px;display:grid;place-items:center;opacity:0;color:#72efdc;font-size:17px;font-weight:900;}
.am51-option[aria-selected="true"] .am51-check{opacity:1;}
/* Keep the two academic pathways' labels and field spacing harmonized. */
.ah35-field:has(> .am51-select),.v13-field:has(> .am51-select){gap:9px;}
.ah35-field:has(> .am51-select)>span,.v13-field:has(> .am51-select)>span{color:#cde9ef;font-size:13px;letter-spacing:0;font-weight:800;}
@media(max-width:600px){
 .am51-trigger{min-height:56px;border-radius:14px;padding-inline:11px;gap:10px;font-size:13px;}
 .am51-glyph{width:35px;height:35px;border-radius:10px;}
 .am51-popup{border-radius:15px;padding:6px;}
 .am51-option{font-size:12.5px;min-height:49px;}
}
@media(prefers-reduced-motion:reduce){.am51-trigger,.am51-option,.am51-arrow{transition:none}.am51-popup{animation:none}}
