/* ── BUTTONS ──
   One loud button per screen (.btn-primary: accent with an ink outline and a
   shadow it presses into). The coloured buttons are soft tints, so a row of
   them reads as a toolbar rather than a rainbow. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 13px; border-radius: var(--r-sm);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: transform var(--dur-1) var(--ease-out), box-shadow var(--dur-1) var(--ease-out), background-color var(--dur-2) var(--ease-out),
              border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), filter var(--dur-2); }
.btn:hover { background: var(--surface-2); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: default; transform: none; }
.btn-primary { background: var(--accent); color: var(--on-accent); font-weight: 600; border: 1.5px solid var(--press-color); box-shadow: 2px 2px 0 var(--press-color); }
.btn-primary:hover { background: var(--accent-hover); transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--press-color); }
.btn-primary:active { transform: translate(2px, 2px); box-shadow: 0 0 0 var(--press-color); transition-timing-function: var(--ease-spring); }
.btn-green  { background: var(--sage);   color: var(--sage-ink);   border-color: var(--sage-line); }
.btn-orange { background: var(--peach);  color: var(--peach-ink);  border-color: var(--peach-line); }
.btn-purple { background: var(--lilac);  color: var(--lilac-ink);  border-color: var(--lilac-line); }
.btn-red    { background: var(--rose);   color: var(--rose-ink);   border-color: var(--rose-line); }
.btn-yellow { background: var(--butter); color: var(--butter-ink); border-color: var(--butter-line); }
.btn-teal   { background: var(--mint);   color: var(--mint-ink);   border-color: var(--mint-line); }
.btn-cyan   { background: var(--sky);    color: var(--sky-ink);    border-color: var(--sky-line); }
.btn-gray   { background: var(--surface-3); color: var(--ink-2);   border-color: var(--line-strong); }
.btn-green:hover, .btn-orange:hover, .btn-purple:hover, .btn-red:hover, .btn-yellow:hover, .btn-teal:hover, .btn-cyan:hover, .btn-gray:hover { filter: brightness(.96); }
:root[data-theme="dark"] .btn-green:hover, :root[data-theme="dark"] .btn-orange:hover, :root[data-theme="dark"] .btn-purple:hover, :root[data-theme="dark"] .btn-red:hover,
:root[data-theme="dark"] .btn-yellow:hover, :root[data-theme="dark"] .btn-teal:hover, :root[data-theme="dark"] .btn-cyan:hover, :root[data-theme="dark"] .btn-gray:hover { filter: brightness(1.15); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--surface-2); color: var(--ink); }
.btn-soft { background: var(--accent-soft); border-color: transparent; color: var(--accent-ink); }
.btn-ai { background: var(--lilac); color: var(--lilac-ink); border-color: var(--lilac-line); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn-xs { height: 24px; padding: 0 8px; font-size: 11px; border-radius: 6px; gap: 4px; }
.btn-lg { height: 44px; padding: 0 20px; font-size: 14px; border-radius: var(--r-md); }
.btn-icon { width: 34px; padding: 0; }
.btn-sm.btn-icon { width: 30px; } .btn-xs.btn-icon { width: 24px; }
.btn svg:not(.ico), .btn .icon { width: 14px; height: 14px; flex-shrink: 0; }
.btn .ico { width: 15px; height: 15px; vertical-align: 0; }
.btn-xs .ico { width: 13px; height: 13px; }

/* ── CARDS ── */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.card-header { padding: 14px 18px; border-bottom: 1px solid var(--line); font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -.01em;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-body { padding: 18px; }
.card.is-interactive { cursor: pointer; transition: transform var(--dur-2) var(--ease-spring), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out); }
.card.is-interactive:hover { transform: translate(-2px, -2px); border-color: var(--press-color); box-shadow: 4px 4px 0 var(--press-color); }
.card.is-interactive:active { transform: none; box-shadow: 1px 1px 0 var(--press-color); }

/* ── FORM ELEMENTS ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--ink-2); margin-bottom: 6px; }
.form-control { width: 100%; min-height: 38px; padding: 8px 12px; border: 1px solid var(--line-strong); border-radius: var(--r-sm); font-size: 13px;
  background: var(--surface); color: var(--ink); outline: none; transition: border-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out); }
textarea.form-control { line-height: 1.55; }
.form-control::placeholder { color: var(--muted); }
.form-control:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }

/* ── TOAST — pills under the top bar ── */
#toast-container { position: fixed; top: 66px; left: 50%; transform: translateX(-50%); z-index: 9999; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 10px; max-width: min(560px, 92vw); padding: 8px 16px 8px 8px; border-radius: var(--r-pill);
  background: var(--ink); color: var(--paper); font-size: 13px; font-weight: 500; box-shadow: var(--shadow-float); animation: toast-in var(--dur-3) var(--ease-spring); }
.toast::before { content: ''; width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0; background-position: center; background-repeat: no-repeat; background-size: 14px; }
.toast-success::before { background-color: var(--sage);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2322633A' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E"); }
.toast-error::before { background-color: var(--rose);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A3302A' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 8v5M12 17h.01'/%3E%3C/svg%3E"); }
.toast-info::before { background-color: var(--sky);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231E4E80' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M12 16v-4M12 8h.01'/%3E%3C/svg%3E"); }
.toast.is-leaving { animation: toast-out var(--dur-2) var(--ease-in-out) forwards; }

/* ── MODAL — a drawer from the right (forms keep the page visible beside them) ── */
.modal-backdrop { position: fixed; inset: 0; background: var(--overlay); z-index: 500; display: flex; align-items: stretch; justify-content: flex-end;
  animation: fade-in var(--dur-2) var(--ease-out); }
.modal { background: var(--surface); width: 480px; max-width: 100vw; height: 100%; max-height: 100vh; overflow-y: auto; overscroll-behavior: contain;
  border-left: 1px solid var(--line); border-radius: var(--r-xl) 0 0 var(--r-xl); box-shadow: var(--shadow-float);
  display: flex; flex-direction: column; animation: drawer-in var(--dur-3) var(--ease-out); }
.modal-lg { width: 760px; }
.modal-xl { width: min(1080px, 96vw); }
.modal-backdrop.no-anim, .modal-backdrop.no-anim .modal { animation: none; }
.modal-ghost { position: fixed; inset: 0; background: var(--overlay); z-index: 499; display: flex; align-items: stretch; justify-content: flex-end; pointer-events: none;
  animation: fade-out var(--dur-2) var(--ease-out) forwards; }
.modal-ghost .modal { animation: drawer-out var(--dur-2) var(--ease-in-out) forwards; }
/* A sheet: rises from the bottom, within reach of a thumb (phones: the learner, Tools, a learner's grades). */
.modal-backdrop:has(.modal-sheet), .modal-ghost:has(.modal-sheet) { align-items: flex-end; justify-content: stretch; }
.modal.modal-sheet { width: 100% !important; max-width: 100% !important; height: auto; max-height: 88vh; border-left: 0; border-top: 1px solid var(--line); border-radius: var(--r-xl) var(--r-xl) 0 0; animation: sheet-in var(--dur-3) var(--ease-out); padding-bottom: env(safe-area-inset-bottom, 0px); }
.modal-ghost .modal.modal-sheet { animation: sheet-out var(--dur-2) var(--ease-in-out) forwards; }
.sheet-grab { width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto 0; flex-shrink: 0; }
.modal-header { position: sticky; top: 0; z-index: 2; padding: 18px 22px 14px; background: var(--surface); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.modal-header h2 { font-size: 19px; font-weight: 700; }
.modal-body { padding: 20px 22px; flex: 1; }
.modal-footer { position: sticky; bottom: 0; z-index: 2; padding: 14px 22px; background: var(--surface); border-top: 1px solid var(--line);
  display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.modal-close { width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer;
  color: var(--muted); font-size: 18px; line-height: 1; border-radius: 8px; transition: background-color var(--dur-1), color var(--dur-1), transform var(--dur-2) var(--ease-spring); }
.modal-close:hover { background: var(--surface-2); color: var(--ink); transform: rotate(90deg); }

/* ── CONFIRM — pops up next to the button that asked ── */
.confirm-pop { position: fixed; z-index: 1300; width: 300px; max-width: calc(100vw - 24px); padding: 16px; border-radius: var(--r-md); background: var(--surface);
  border: 1px solid var(--line); box-shadow: var(--shadow-float); animation: pop-in var(--dur-2) var(--ease-spring); }
.confirm-pop h3 { font-size: 15px; margin-bottom: 4px; }
.confirm-pop p { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.confirm-pop .row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.confirm-pop.is-leaving { animation: fade-out var(--dur-1) var(--ease-out) forwards; }
.confirm-pop::before { content: ''; position: absolute; width: 12px; height: 12px; background: var(--surface); border-left: 1px solid var(--line); border-top: 1px solid var(--line);
  transform: rotate(45deg); top: -7px; left: var(--arrow-x, 24px); }
.confirm-pop.above::before { top: auto; bottom: -7px; transform: rotate(225deg); }
.confirm-pop.centered::before { display: none; }
.btn-danger { background: var(--rose); color: var(--rose-ink); border-color: var(--rose-line); font-weight: 600; }
.btn-danger:hover { filter: brightness(.96); background: var(--rose); }

/* A page opened as a drawer (New Class, New Subject Class, Enroll) */
.page-modal { position: relative; }
.page-modal-close { position: sticky; top: 10px; align-self: flex-end; margin: 10px 12px -46px 0; z-index: 4; background: var(--surface); border: 1px solid var(--line); }
.page-drawer { padding: 8px 22px 22px; }
.page-drawer > div { margin-top: 0 !important; max-width: none !important; }
.page-drawer .card { box-shadow: none; border: none; background: none; }
.page-drawer .card-header { padding-left: 0; padding-right: 52px; }
.page-drawer .card-body { padding-left: 0; padding-right: 0; }

/* CMS Interactive on the Lesson Plans page: a slim strip in the home
   banner's colours (home.css .ix-banner), with the same white button. */
.ix-strip { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; padding: 10px 12px 10px 16px; border-radius: var(--radius); color: #fff;
  background: linear-gradient(115deg, #B7472A 0%, #D2612F 45%, #E9923A 100%); border: 1.5px solid var(--press-color); box-shadow: 3px 3px 0 var(--press-color); }
.ix-strip-ic { font-size: 22px; }
.ix-strip-text { flex: 1; min-width: 0; font-size: 14px; }
.ix-strip-text strong { font-family: var(--font-display); font-size: 16px; margin-right: 6px; }
.ix-strip .ix-go { padding: 8px 14px; font-size: 13px; }
@media (max-width: 640px) { .ix-strip { flex-wrap: wrap; } .ix-strip .ix-go { width: 100%; justify-content: center; } }
