/* The counselling popup (includes/admission_guide_enquiry_popup.blade.php): one slim card, white and
   ink with the brand green kept to small accents; a bottom sheet on phones. Colours follow
   html[data-theme] through css/site/tokens.css. Sized to fit a 570px-tall laptop window unscrolled. */
.ag-enq {
  --enq-line: #E4E9E7;
  --enq-field: #FFFFFF;
  --enq-btn: #11211C;
  --enq-btn-hover: #1E3730;
  --enq-btn-text: #FFFFFF;
  --enq-ring: rgba(18, 163, 122, .16);
  --enq-glow: rgba(18, 163, 122, .09);
  --enq-error: #C2410C;
  box-sizing: border-box;
  width: min(470px, calc(100% - 24px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ag-ink);
  font-family: var(--ag-font);
  overflow: visible;
}
html[data-theme="dark"] .ag-enq {
  --enq-line: var(--ag-line);
  --enq-field: var(--ag-surface-2);
  --enq-btn: var(--ag-ink);
  --enq-btn-hover: #FFFFFF;
  --enq-btn-text: #0A1411;
  --enq-glow: rgba(52, 211, 153, .08);
  --enq-error: #FDBA74;
}
/* The page behind stays put while the popup is open. */
html:has(.ag-enq[open]) { overflow: hidden; }
.ag-enq *, .ag-enq *::before, .ag-enq *::after { box-sizing: border-box; }
.ag-enq::backdrop { background: rgba(8, 15, 12, .45); backdrop-filter: blur(3px); }
.ag-enq[open]::backdrop { animation: agEnqFade .3s ease both; }

.ag-enq-card {
  position: relative;
  isolation: isolate;
  max-height: calc(100dvh - 24px);
  overflow-x: hidden;
  overflow-y: auto; /* only on very short screens */
  overscroll-behavior: contain;
  scrollbar-width: thin;
  padding: 22px 24px 18px;
  border: 1px solid var(--enq-line);
  border-radius: 20px;
  background: radial-gradient(120% 70% at 100% 0%, var(--enq-glow), transparent 60%), var(--ag-surface);
  box-shadow: 0 24px 64px rgba(10, 20, 16, .22), 0 2px 6px rgba(10, 20, 16, .06);
}
.ag-enq-card:focus { outline: none; }
.ag-enq[open] .ag-enq-card { animation: agEnqIn .42s var(--ag-ease) both; }

.ag-enq-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(17, 33, 28, .06);
  color: var(--ag-ink);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.ag-enq-close:hover { background: rgba(17, 33, 28, .12); transform: rotate(90deg); }
html[data-theme="dark"] .ag-enq-close { background: rgba(255, 255, 255, .08); }
html[data-theme="dark"] .ag-enq-close:hover { background: rgba(255, 255, 255, .14); }
.ag-enq-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

.ag-enq-brand { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.ag-enq-mark { display: block; width: 28px; height: 28px; object-fit: contain; }
.ag-enq-mark--dark { display: none; }
html[data-theme="dark"] .ag-enq-mark--light { display: none; }
html[data-theme="dark"] .ag-enq-mark--dark { display: block; }
.ag-enq-eyebrow { font-size: .7rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ag-brand); }
.ag-enq-title { margin: 0; padding-right: 36px; font-size: 1.3rem; font-weight: 700; line-height: 1.25; letter-spacing: -.01em; color: var(--ag-ink); text-wrap: balance; }
.ag-enq-sub { margin: 4px 0 0; font-size: .84rem; line-height: 1.5; color: var(--ag-muted); text-wrap: pretty; }
.ag-enq-points { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; }
.ag-enq-points li { display: inline-flex; gap: 6px; align-items: center; font-size: .76rem; font-weight: 500; color: var(--ag-text); }
.ag-enq-points svg { flex: none; width: 16px; height: 16px; padding: 3px; border-radius: 50%; background: var(--ag-brand-soft); fill: none; stroke: var(--ag-brand); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }

.ag-enq form { display: grid; gap: 12px; margin-top: 16px; }
.ag-enq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ag-enq-field { display: grid; gap: 4px; min-width: 0; }
.ag-enq-field label { font-size: .74rem; font-weight: 600; color: var(--ag-ink); }
.ag-enq-field input,
.ag-enq-phone {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--enq-line);
  border-radius: 10px;
  background: var(--enq-field);
  color: var(--ag-ink);
  font: inherit;
  font-size: .88rem;
  transition: border-color .2s, box-shadow .2s;
}
.ag-enq-field input { padding: 8px 12px; }
.ag-enq-field input::placeholder { color: var(--ag-muted); opacity: .7; }
.ag-enq-field input:focus { outline: none; border-color: var(--ag-brand-mid); box-shadow: 0 0 0 3px var(--enq-ring); }
.ag-enq-phone { display: flex; align-items: stretch; overflow: hidden; }
.ag-enq-phone span { display: grid; place-items: center; padding: 0 10px; border-right: 1px solid var(--enq-line); font-size: .84rem; font-weight: 500; color: var(--ag-text); }
.ag-enq-phone input { min-width: 0; min-height: 0; border: 0; border-radius: 0; background: transparent; }
.ag-enq-phone input:focus { box-shadow: none; }
.ag-enq-phone:focus-within { border-color: var(--ag-brand-mid); box-shadow: 0 0 0 3px var(--enq-ring); }
.ag-enq form.is-tried input:invalid,
.ag-enq form.is-tried .ag-enq-phone:has(input:invalid) { border-color: var(--enq-error); }
.ag-enq form.is-tried .ag-enq-phone input:invalid { border: 0; }

.ag-enq-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: -2px; }
.ag-enq-chips span { margin-right: 2px; font-size: .72rem; color: var(--ag-muted); }
.ag-enq-chip {
  padding: 3px 10px;
  border: 1px solid var(--enq-line);
  border-radius: 999px;
  background: transparent;
  color: var(--ag-text);
  font: inherit;
  font-size: .74rem;
  font-weight: 500;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s;
}
.ag-enq-chip:hover { border-color: var(--ag-brand-mid); color: var(--ag-ink); }
.ag-enq-chip[aria-pressed="true"] { border-color: var(--ag-brand); background: var(--ag-brand-soft); color: var(--ag-brand); }

.ag-enq-consent { display: flex; gap: 8px; align-items: flex-start; font-size: .74rem; line-height: 1.5; color: var(--ag-muted); cursor: pointer; }
.ag-enq-consent input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; accent-color: var(--ag-brand); }
.ag-enq-consent a { color: var(--ag-ink); text-decoration: underline; text-underline-offset: 2px; }
.ag-enq-status { margin: 0; padding: 8px 10px; border-radius: 9px; background: rgba(194, 65, 12, .08); color: var(--enq-error); font-size: .78rem; line-height: 1.45; }

.ag-enq-submit {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  background: var(--enq-btn);
  color: var(--enq-btn-text);
  font: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s, transform .15s;
}
.ag-enq-submit:hover { background: var(--enq-btn-hover); }
.ag-enq-submit:active { transform: scale(.99); }
.ag-enq-submit:focus-visible, .ag-enq-chip:focus-visible, .ag-enq-close:focus-visible { outline: 2px solid var(--ag-brand-mid); outline-offset: 2px; }
.ag-enq-arrow { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .2s; }
.ag-enq-submit:hover .ag-enq-arrow { transform: translateX(3px); }
.ag-enq-spinner { display: none; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: agEnqSpin .7s linear infinite; }
.ag-enq-submit.is-busy { cursor: progress; opacity: .85; }
.ag-enq-submit.is-busy .ag-enq-spinner { display: inline-block; }
.ag-enq-submit.is-busy .ag-enq-arrow { display: none; }
.ag-enq-note { display: flex; gap: 5px; align-items: center; justify-content: center; margin: -4px 0 0; font-size: .7rem; color: var(--ag-muted); }
.ag-enq-note svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* Thank-you view: the check draws itself inside a soft glow, then the text rises in. */
.ag-enq-done { display: grid; justify-items: center; padding: 14px 4px 4px; text-align: center; }
.ag-enq-done[hidden] { display: none; }
.ag-enq-check { position: relative; width: 68px; height: 68px; margin-bottom: 14px; }
.ag-enq-check::before {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--ag-glow) 0%, transparent 70%);
  animation: agEnqGlow 1.6s ease-out .35s both;
}
.ag-enq-check svg { position: relative; width: 100%; height: 100%; fill: none; stroke: var(--ag-brand-mid); stroke-linecap: round; stroke-linejoin: round; }
.ag-enq-check circle { stroke-width: 3; stroke-dasharray: 176; stroke-dashoffset: 176; transform: rotate(-90deg); transform-origin: center; animation: agEnqDraw .7s var(--ag-ease) forwards; }
.ag-enq-check path { stroke-width: 4; stroke-dasharray: 40; stroke-dashoffset: 40; animation: agEnqDraw .4s var(--ag-ease) .6s forwards; }
.ag-enq-done .ag-enq-title { padding: 0; outline: none; animation: agEnqRise .5s var(--ag-ease) .55s both; }
.ag-enq-done-swoosh { width: 130px; height: 12px; margin-top: 4px; fill: none; stroke: var(--ag-brand-mid); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 160; stroke-dashoffset: 160; animation: agEnqDraw .6s var(--ag-ease) .8s forwards; }
.ag-enq-done .ag-enq-sub { max-width: 340px; margin-top: 8px; animation: agEnqRise .5s var(--ag-ease) .7s both; }
.ag-enq-ghost { width: auto; min-width: 140px; margin-top: 16px; animation: agEnqRise .5s var(--ag-ease) .85s both; }

@keyframes agEnqIn { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes agEnqUp { from { transform: translateY(100%); } to { transform: none; } }
@keyframes agEnqFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes agEnqSpin { to { transform: rotate(360deg); } }
@keyframes agEnqDraw { to { stroke-dashoffset: 0; } }
@keyframes agEnqRise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes agEnqGlow { 0% { opacity: 0; transform: scale(.5); } 40% { opacity: 1; } 100% { opacity: .55; transform: scale(1.15); } }

/* Phones: a bottom sheet. Name and course take the full width; mobile and email share a row. */
@media (max-width: 520px) {
  .ag-enq { width: 100%; margin: auto 0 0; }
  .ag-enq-card {
    max-height: 92dvh;
    padding: 20px 16px calc(14px + env(safe-area-inset-bottom));
    border-width: 1px 0 0;
    border-radius: 20px 20px 0 0;
  }
  .ag-enq[open] .ag-enq-card { animation: agEnqUp .38s var(--ag-ease) both; }
  .ag-enq-title { font-size: 1.15rem; }
  .ag-enq-points, .ag-enq-chips span { display: none; }
  .ag-enq form { margin-top: 14px; }
  .ag-enq-grid { gap: 8px 10px; }
  .ag-enq-field:first-child, .ag-enq-field:last-child { grid-column: 1 / -1; }
}
@media (prefers-reduced-motion: reduce) {
  .ag-enq *, .ag-enq *::before, .ag-enq::backdrop, .ag-enq-card { animation-duration: .01ms !important; animation-delay: 0s !important; transition: none !important; }
}
