/* =========================================================================
   Afritech Portal System - Student / Guardian / Instructor Portal (Frontend)
   Mobile-first, bilingual, accessible.
   ========================================================================= */

.afps-portal,
.afps-portal * { box-sizing: border-box; }

/* Respect a reduced-motion preference across the whole portal. */
@media (prefers-reduced-motion: reduce) {
  .afps-portal *,
  .afps-auth-gate * {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

.afps-portal {
  --afps-p-bg:        #f5f7fb;
  --afps-p-surface:   #ffffff;
  --afps-p-surface-2: #f8fafc;
  --afps-p-border:    #e5e9f0;
  --afps-p-text:      #0f172a;
  --afps-p-text-mute: #64748b;
  --afps-p-brand:     #1c3f9e;
  --afps-p-brand-2:   #0b1f4e;
  --afps-p-accent:    #f5b40a;
  --afps-p-success:   #10b981;
  --afps-p-warning:   #f59e0b;
  --afps-p-danger:    #ef4444;
  --afps-p-radius:    14px;
  --afps-p-radius-sm: 10px;
  /* Softer, layered elevation to match the refreshed admin surfaces. */
  --afps-p-shadow:    0 2px 4px rgba(15,23,42,.04), 0 12px 28px rgba(15,23,42,.08);
  --afps-p-shadow-sm: 0 1px 2px rgba(15,23,42,.05), 0 2px 6px rgba(15,23,42,.05);

  width: 100%;
  max-width: none;
  min-height: calc(100vh - var(--afi-header-h, 76px));
  margin: 0;
  padding: 18px clamp(16px, 2vw, 32px) 48px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--afps-p-text);
  background: var(--afps-p-bg);
  border-radius: var(--afps-p-radius);
}
body.afi-role-portal-authenticated .afps-portal {
  min-height: calc(100vh - var(--afi-portal-top-offset, 0px));
  min-height: calc(100dvh - var(--afi-portal-top-offset, 0px));
  border-radius: 0;
}
.afps-portal a { color: var(--afps-p-brand); text-decoration: none; transition: color 160ms ease; }
.afps-portal a:hover { color: #16327e; text-decoration: underline; }
.afps-portal .afps-portal-contact {
  display: flex;
  width: fit-content;
  margin: 12px auto 0;
  padding: 9px 15px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--afps-p-brand);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  line-height: 1.2;
  box-shadow: 0 5px 12px rgba(28, 63, 158, .22);
}
.afps-portal .afps-portal-contact:hover { background: #16327e; color: #fff; text-decoration: none; }
.afps-portal--missing-profile {
  display: grid;
  min-height: min(560px, calc(100dvh - var(--afi-portal-top-offset, 0px) - 48px));
  place-items: center;
  padding: clamp(24px, 5vw, 64px) 20px;
}
.afps-missing-profile {
  width: min(100%, 420px);
  padding: 30px 26px;
  border: 1px solid var(--afps-p-border);
  border-radius: var(--afps-p-radius);
  background: var(--afps-p-surface);
  box-shadow: var(--afps-p-shadow);
  text-align: center;
}
.afps-missing-profile p {
  margin: 0;
  color: var(--afps-p-text-mute);
}
.afps-portal h1, .afps-portal h2, .afps-portal h3 { letter-spacing: -0.02em; margin: 0; }
.afps-portal h2 { font-size: 20px; font-weight: 700; color: var(--afps-p-text); }

/* ---------- Header hero ---------- */
.afps-portal-header {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(900px 260px at 110% -10%, rgba(245,180,10,.28), transparent 60%),
    radial-gradient(700px 300px at -10% 120%, rgba(255,255,255,.10), transparent 60%),
    linear-gradient(135deg, #0b1f4e 0%, #14307a 50%, #1c3f9e 100%);
  color: #fff;
  padding: 26px 26px;
  border-radius: var(--afps-p-radius);
  margin-bottom: 18px;
  box-shadow: var(--afps-p-shadow);
}
.afps-portal-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 36px 36px;
  pointer-events: none;
}
.afps-portal-header > * { position: relative; z-index: 1; }
.afps-portal-header h1 {
  margin: 0;
  font-size: 27px;
  font-weight: 700;
  color: #fff;
}
.afps-portal-header .meta {
  color: #dbeafe;
  font-size: 16px;
  margin-top: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.afps-portal-header .badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(4px);
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
}
.afps-portal-header .badge.nqd::before { content: "🎓 "; }
.afps-portal-header .badge.hnd::before { content: "🏆 "; }

/* ---------- Sticky tab nav ---------- */
.afps-portal-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px;
  /* Frosted, translucent bar so section content scrolls softly beneath it. */
  background: var(--afps-p-surface);
  background: color-mix(in srgb, var(--afps-p-surface) 80%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border: 1px solid var(--afps-p-border);
  border-radius: var(--afps-p-radius);
  margin-bottom: 14px;
  box-shadow: var(--afps-p-shadow-sm);
  position: sticky;
  top: 10px;
  z-index: 5;
}
.afps-portal-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 15px;
  font-weight: 600;
  color: var(--afps-p-text-mute);
  border-radius: 8px;
  transition: background 160ms ease, color 160ms ease;
  background: transparent;
}
.afps-portal-nav a:hover {
  background: var(--afps-p-surface-2);
  color: var(--afps-p-text);
  text-decoration: none;
}
.afps-portal-nav a:target,
.afps-portal-nav a.active {
  background: var(--afps-p-text);
  color: #fff;
}

/* ---------- Section card ---------- */
.afps-portal-section {
  background: var(--afps-p-surface);
  border: 1px solid var(--afps-p-border);
  border-radius: var(--afps-p-radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  box-shadow: var(--afps-p-shadow-sm);
  scroll-margin-top: 80px;
}
.afps-portal-section h2 {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #0b1f4e;
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--afps-p-border);
}
.afps-portal-section h2::before {
  content: "";
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--afps-p-brand), var(--afps-p-brand-2));
}
.afps-portal-section h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 16px 0 8px;
  color: var(--afps-p-text);
}

/* ---------- Tables ---------- */
.afps-portal-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15.5px;
  border: 1px solid var(--afps-p-border);
  border-radius: 10px;
  overflow: hidden;
}
.afps-portal-table thead th {
  background: var(--afps-p-surface-2);
  color: var(--afps-p-text-mute);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--afps-p-border);
}
.afps-portal-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--afps-p-border);
  vertical-align: middle;
}
.afps-portal-table tr:last-child td { border-bottom: 0; }
.afps-portal-table tr:hover td { background: rgba(28,63,158,.04); }

/* ---------- Stat pills ---------- */
.afps-portal-stats {
  list-style: none;
  padding: 0;
  margin: 10px 0 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.afps-portal-stats li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--afps-p-surface-2);
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--afps-p-border);
  font-size: 15px;
  color: var(--afps-p-text-mute);
  text-transform: capitalize;
}
.afps-portal-stats li strong {
  font-size: 20px;
  color: var(--afps-p-text);
  margin-right: 4px;
  letter-spacing: -0.02em;
}

/* ---------- KPI cards ---------- */
.afps-portal-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-top: 4px;
}
.afps-portal-cards > div {
  position: relative;
  background: linear-gradient(180deg, var(--afps-p-surface), var(--afps-p-surface-2));
  padding: 16px 14px;
  border-radius: 12px;
  text-align: center;
  border: 1px solid var(--afps-p-border);
  overflow: hidden;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}
.afps-portal-cards > div:hover {
  transform: translateY(-2px);
  box-shadow: var(--afps-p-shadow);
  border-color: #d4dbe6;
}
.afps-portal-cards > div::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--afps-p-brand), var(--afps-p-brand-2));
  opacity: .7;
}
.afps-portal-cards > div span {
  display: block;
  color: var(--afps-p-text-mute);
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 4px;
}
.afps-portal-cards > div strong {
  display: block;
  font-size: 24px;
  color: var(--afps-p-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ---------- Empty state ---------- */
.afps-portal-section > p:only-of-type,
.afps-portal > p:only-of-type {
  text-align: center;
  padding: 28px 18px;
  color: var(--afps-p-text-mute);
  background: var(--afps-p-surface-2);
  border-radius: 10px;
  margin: 8px 0;
}

/* ---------- Portal workspace shell ---------- */
.afps-portal-workspace { min-width: 0; }
.afps-portal-workspace [hidden] { display: none !important; }
.afps-portal-sidebar { display: none; }
.afps-portal-skip {
  position: fixed;
  top: 8px;
  left: -9999px;
  z-index: 1000;
  padding: 10px 14px;
  border-radius: 8px;
  background: #fff;
  color: #0b1f4e;
  font-weight: 800;
  box-shadow: var(--afps-p-shadow);
}
.afps-portal-skip:focus { left: 8px; }
.afps-portal-menu-close,
.afps-portal-mobile-bar,
.afps-portal-backdrop { display: none; }
.afps-sidebar-actions {
  display: grid;
  gap: 2px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .14);
}
.afps-sidebar-actions a {
  padding: 9px 12px;
  color: rgba(255, 255, 255, .72) !important;
  font-size: 13px;
  font-weight: 700;
}
.afps-sidebar-actions a:hover,
.afps-sidebar-actions a:focus-visible {
  color: #f5b40a !important;
  text-decoration: none !important;
}
.afps-sidebar-language { margin-top: 14px; }
.afps-sidebar-language .afi-lang-switch {
  margin: 0;
  border-color: rgba(255,255,255,.18);
  background: rgba(255,255,255,.1);
}
.afps-sidebar-language .afi-lang-switch-item { color: rgba(255,255,255,.72); }
.afps-sidebar-language .afi-lang-switch-item:hover { color: #fff; }
.afps-sidebar-language .afi-lang-switch-item.is-active {
  background: #ffcc00;
  color: #071a45;
}
.afps-portal-profile {
  display: flex;
  gap: 16px;
  align-items: center;
  min-width: 0;
}
.afps-portal-profile-avatar {
  display: flex;
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255,255,255,.28);
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  backdrop-filter: blur(4px);
}
.afps-portal-profile-copy {
  min-width: 0;
  flex: 1;
}
.afps-portal-meta-separator { opacity: .5; }
.afps-portal-note {
  margin-top: 10px;
  color: var(--afps-p-text-mute);
  font-size: 12.5px;
}
.afps-table-scroll {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
  scrollbar-width: thin;
  scrollbar-color: #aebbd0 transparent;
}
.afps-table-scroll:focus-visible {
  outline: 3px solid rgba(28,63,158,.28);
  outline-offset: 3px;
}
.afps-table-scroll .afps-portal-table { min-width: 620px; }
.afps-table-scroll--compact .afps-portal-table { min-width: 480px; }
.afps-empty {
  display: grid;
  justify-items: start;
  gap: 5px;
  padding: 20px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: var(--afps-p-surface-2);
  color: var(--afps-p-text-mute);
}
.afps-empty strong { color: var(--afps-p-text); font-size: 15px; }
.afps-empty span { font-size: 14px; }
.afps-class-block + .afps-class-block {
  margin-top: 24px;
  padding-top: 22px;
  border-top: 1px solid var(--afps-p-border);
}
.afps-class-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.afps-class-action {
  font-size: 13px;
  font-weight: 700;
}
.afps-child-name {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}
.afps-child-name .meta {
  color: var(--afps-p-text-mute);
  font-size: 13px;
  font-weight: 600;
}
.afps-portal-announcement {
  margin-bottom: 10px;
  padding: 12px 16px;
  border: 1px solid var(--afps-p-border);
  border-radius: 10px;
  background: #fff;
}
.afps-portal-announcement:last-child { margin-bottom: 0; }
.afps-portal-announcement summary {
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
  cursor: pointer;
  font-weight: 700;
}
.afps-announcement-date {
  margin-left: auto;
  color: var(--afps-p-text-mute);
  font-size: 12.5px;
  font-weight: 400;
}
.afps-announcement-pin { font-weight: 500; }
.afps-announcement-body { margin-top: 10px; }

@media (min-width: 961px) {
  /* The three signed-in portals use the two-column workspace.  The public
     verification form stays a centred, single-panel experience. */
  .afi-app-page .afps-portal:not(.afps-verify) {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr);
    gap: 0;
    align-items: stretch;
    padding: 0;
    border-radius: 0;
    background: transparent;
  }
  .afi-app-page .afps-portal.afps-portal--missing-profile {
    grid-template-columns: minmax(0, 1fr);
    align-items: center;
  }
  .afps-portal-sidebar {
    display: flex;
    position: sticky;
    top: calc(var(--afi-header-h, 76px) + 18px);
    min-height: 500px;
    flex-direction: column;
    padding: 22px 14px 16px;
    border-radius: 18px;
    background: linear-gradient(165deg, #102b67 0%, #071a45 100%);
    box-shadow: 0 16px 36px rgba(11, 31, 78, .18);
    color: #fff;
  }
  body.afi-role-portal-authenticated .afps-portal-sidebar {
    top: 0;
    height: calc(100vh - var(--afi-portal-top-offset, 0px));
    height: calc(100dvh - var(--afi-portal-top-offset, 0px));
    min-height: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .afps-portal-sidebar .afps-portal-nav {
    display: flex;
    position: static;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin: 18px 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .afps-portal-sidebar .afps-portal-nav a {
    width: 100%;
    padding: 10px 12px;
    border-radius: 9px;
    color: rgba(255, 255, 255, .78);
  }
  .afps-portal-sidebar .afps-portal-nav a:hover,
  .afps-portal-sidebar .afps-portal-nav a:focus-visible {
    background: rgba(255, 255, 255, .12);
    color: #fff;
  }
  .afps-portal-workspace {
    padding: clamp(20px, 2vw, 32px);
  }
  .afps-portal-workspace .afps-portal-header { margin-bottom: 20px; }
}

.afps-sidebar-kicker {
  margin: 0 0 14px;
  color: #f5b40a;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
}
.afps-sidebar-brand {
  display: flex;
  margin: 0 0 14px;
  align-items: center;
  gap: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .01em;
  line-height: 1.2;
}
.afps-sidebar-brand img {
  width: 30px;
  height: 30px;
  flex: none;
  border: 1px solid rgba(255, 255, 255, .32);
  border-radius: 50%;
  background: #fff;
  object-fit: cover;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .18);
}
.afps-sidebar-user { display: flex; align-items: center; gap: 10px; }
.afps-sidebar-user > span:last-child { display: grid; gap: 2px; min-width: 0; }
.afps-sidebar-user strong { overflow: hidden; font-size: 16px; text-overflow: ellipsis; white-space: nowrap; }
.afps-sidebar-user small { color: rgba(255, 255, 255, .64); font-size: 13px; }
.afps-sidebar-avatar {
  display: inline-flex;
  width: 38px;
  height: 38px;
  flex: none;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 50%;
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}
.afps-portal-sidebar .afps-portal-nav a:target,
.afps-portal-sidebar .afps-portal-nav a.active {
  background: #ffcc00;
  color: #071a45;
}
@media (max-width: 960px) {
  body.afps-portal-nav-visible { overflow: hidden; }
  .afps-portal {
    display: block;
    padding: 0;
  }
  .afps-portal-sidebar {
    display: flex;
    position: fixed;
    inset: var(--afi-portal-top-offset, 0px) auto 0 0;
    z-index: 80;
    width: min(86vw, 320px);
    height: calc(100dvh - var(--afi-portal-top-offset, 0px));
    min-height: 0;
    margin: 0;
    padding: 22px 16px 18px;
    flex-direction: column;
    border-radius: 0;
    background: linear-gradient(165deg, #102b67 0%, #071a45 100%);
    box-shadow: 18px 0 50px rgba(0,0,0,.28);
    color: #fff;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .afps-portal-nav-open .afps-portal-sidebar { transform: translateX(0); }
  .afps-portal-menu-close {
    position: absolute;
    top: 14px;
    right: 12px;
    display: inline-flex;
    width: 40px;
    height: 40px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,.2);
    border-radius: 10px;
    background: rgba(255,255,255,.1);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
  }
  .afps-portal-sidebar .afps-portal-nav {
    position: static;
    display: flex;
    margin: 18px 0 auto;
    padding: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    background: transparent !important;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .afps-portal-sidebar .afps-portal-nav a {
    width: 100%;
    padding: 11px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, .86);
    white-space: normal;
  }
  .afps-portal-sidebar .afps-portal-nav a:hover { background: rgba(255, 255, 255, .13); color: #fff; }
  .afps-portal-backdrop {
    position: fixed;
    inset: var(--afi-portal-top-offset, 0px) 0 0;
    z-index: 70;
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    border: 0;
    background: rgba(7, 21, 56, .58);
    backdrop-filter: blur(2px);
    cursor: default;
  }
  .afps-portal-backdrop[hidden] { display: none; }
  .afps-portal-mobile-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    min-height: 58px;
    padding: 9px 14px;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--afps-p-border);
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(12px);
  }
  .afps-portal-menu-toggle {
    display: inline-flex;
    min-height: 40px;
    padding: 8px 11px;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--afps-p-border);
    border-radius: 10px;
    background: #fff;
    color: var(--afps-p-text);
    font: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
  }
  .afps-menu-glyph {
    display: grid;
    width: 18px;
    gap: 3px;
  }
  .afps-menu-glyph::before,
  .afps-menu-glyph::after,
  .afps-menu-glyph {
    border-top: 2px solid currentColor;
  }
  .afps-menu-glyph::before,
  .afps-menu-glyph::after { content: ""; }
  .afps-portal-mobile-title {
    overflow: hidden;
    font-size: 14px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .afps-portal-mobile-logout {
    margin-left: auto;
    color: var(--afps-p-brand) !important;
    font-size: 13px;
    font-weight: 800;
  }
  .afps-portal-workspace { padding: 0; }
  .afps-portal-header {
    margin: 16px;
  }
  .afps-portal-workspace > .afps-portal-section,
  .afps-portal-workspace > .afps-portal-view {
    margin-right: 16px;
    margin-left: 16px;
  }
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
  .afps-portal { padding: 0 0 32px; }
  .afps-portal-header { padding: 20px 18px; }
  .afps-portal-header h1 { font-size: 24px; }
  .afps-portal-section { padding: 16px 14px; }
  .afps-portal-nav { position: static; overflow-x: auto; flex-wrap: nowrap; }
  .afps-portal-nav a { white-space: nowrap; }
  .afps-portal-cards { grid-template-columns: repeat(2, 1fr); }
  .afps-portal-table { font-size: 14.5px; }
  .afps-portal-table th, .afps-portal-table td { padding: 8px 10px; }
  .afps-portal-profile { gap: 12px; }
  .afps-portal-profile-avatar {
    width: 48px;
    height: 48px;
    flex-basis: 48px;
    font-size: 18px;
  }
  .afps-portal-header .meta { font-size: 14px; }
  .afps-announcement-date { width: 100%; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .afps-portal-sidebar { transition: none; }
}

/* Custom month picker (portal) */
.afps-monthpicker-pop {
  background: #fff;
  border: 1px solid #e5e9f0;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.15);
  width: 280px;
  padding: 0;
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
.afps-mp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: #1c3f9e;
  color: #fff;
  margin: 0;
}
.afps-mp-head .afps-mp-year { font-weight: 600; font-size: 16px; color: #fff; }
.afps-mp-head button {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
  padding: 4px 10px;
  color: #fff;
  border-radius: 6px;
  opacity: .9;
}
.afps-mp-head button:hover { background: rgba(255, 255, 255, .18); opacity: 1; }
.afps-mp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 12px; }
.afps-mp-month {
  background: #fff;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 12px 0;
  font-size: 15px;
  cursor: pointer;
  color: #0f172a;
  transition: background .15s, color .15s;
}
.afps-mp-month:hover { background: #f1f5f9; color: #16327e; }
.afps-mp-month.is-active { background: #1c3f9e; color: #fff; font-weight: 600; }
.afps-monthpicker-wrap { position: relative; display: inline-block; }
.afps-portal .afps-monthpicker-wrap { width: 100%; }
.afps-monthpicker-wrap .afps-monthpicker-display { padding-right: 34px !important; }
.afps-monthpicker-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: auto;
  cursor: pointer;
  font-size: 16px;
  opacity: .65;
}

/* =========================================================================
   Auth gate - modern login card. Used for the [afritech_portal_system_login] shortcode
   and as the fallback when a visitor hits a portal without the right role.
   ========================================================================= */
.afps-auth-gate {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px;
  background: #eeeeee;
  min-height: calc(100vh - 120px);
  margin: 0;
  max-width: none;
}
/* The login screen is rendered directly in the page section so it can use the
 * entire available width.  Be explicit here: WordPress block layout utilities
 * may otherwise turn this container into a grid and leave the card pinned to
 * the far left on wide screens. */
.afi-app-page > .afi-login-gate {
  display: flex !important;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  max-width: none;
  min-height: calc(100vh - 120px);
  margin: 0;
  padding: 44px 24px 28px;
  background: #eeeeee;
  border-radius: 0;
}
.afi-login-gate,
.afi-login-gate * { box-sizing: border-box; }
.afi-login-gate {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  width: 100%;
  padding: clamp(8px, 1.5vw, 16px) 0;
}
.afi-app-page:has(> .afi-login-gate) { padding-top: 0; }
.afi-login-gate .afps-auth-card { padding: 24px 32px 20px; }
.afi-login-gate .afps-auth-brand { margin-bottom: 12px; }
.afi-login-gate .afps-auth-intro { margin-bottom: 16px; }
.afi-login-gate .afps-auth-form { gap: 10px; }
.afps-auth-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), 0 4px 8px rgba(15, 23, 42, 0.04);
  padding: 32px 32px 28px;
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

.afps-auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #64748b;
  margin-bottom: 18px;
}
.afps-auth-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1c3f9e, #0b1f4e);
  box-shadow: 0 0 0 3px rgba(28, 63, 158, 0.12);
}
.afps-auth-card strong { color: #0f172a; font-weight: 700; letter-spacing: .02em; }

.afps-auth-title {
  margin: 0 0 6px;
  font-size: 24px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.afps-auth-intro {
  margin: 0 0 20px;
  font-size: 16px;
  color: #64748b;
  line-height: 1.5;
}
.afps-auth-meta {
  margin: 0 0 16px;
  font-size: 15px;
  color: #64748b;
}

.afps-auth-alert {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(239, 68, 68, 0.25);
  background: rgba(239, 68, 68, 0.06);
  color: #991b1b;
  font-size: 15px;
  line-height: 1.4;
}
.afps-auth-alert--success { border-color: rgba(5,150,105,.25); background: rgba(5,150,105,.07); color: #065f46; }
.afps-auth-help { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid #eef2f9; color: #64748b; font-size: 13px; line-height: 1.5; text-align: center; }

.afps-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0;
}
.afps-auth-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  font-weight: 600;
  color: #0f172a;
}
.afps-auth-field span { color: #334155; font-weight: 600; }
.afps-auth-field input[type="text"],
.afps-auth-field input[type="email"],
.afps-auth-field input[type="password"] {
  height: 42px;
  padding: 0 12px;
  border: 1px solid #d6deea;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  font-size: 16px;
  color: #0f172a;
  transition: border-color 120ms ease, box-shadow 120ms ease;
  box-shadow: none;
  width: 100%;
  box-sizing: border-box;
}
.afps-auth-field input:focus {
  outline: none;
  border-color: #1c3f9e;
  box-shadow: 0 0 0 4px rgba(28, 63, 158, 0.14);
}

.afps-auth-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 14px;
  color: #475569;
}
.afps-auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.afps-auth-remember input { accent-color: #1c3f9e; }
.afps-auth-inline-link {
  color: #1c3f9e;
  text-decoration: none;
  font-weight: 600;
}
.afps-auth-inline-link:hover { color: #16327e; text-decoration: underline; }

.afps-auth-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 120ms ease, color 120ms ease, border-color 120ms ease, box-shadow 120ms ease;
  width: 100%;
  margin-top: 4px;
  box-sizing: border-box;
}
.afps-auth-btn--primary {
  background: linear-gradient(180deg, #1c3f9e 0%, #16327e 100%);
  color: #fff !important;
  box-shadow: 0 6px 12px rgba(28, 63, 158, 0.25);
}
.afps-auth-btn--primary:hover {
  background: linear-gradient(180deg, #16327e 0%, #122a68 100%);
  color: #fff !important;
}
.afps-auth-actions .afps-auth-btn--primary,
.afps-auth-actions .afps-auth-btn--primary:link,
.afps-auth-actions .afps-auth-btn--primary:visited,
.afps-auth-actions .afps-auth-btn--primary:hover,
.afps-auth-actions .afps-auth-btn--primary:focus {
  color: #fff !important;
}
.afps-auth-btn--primary:active { transform: translateY(1px); }
.afps-auth-btn--ghost {
  background: transparent;
  color: #1c3f9e !important;
  border-color: #d6deea;
}
.afps-auth-btn--ghost:hover {
  background: #f1f5f9;
  color: #16327e !important;
}

.afps-auth-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.afps-auth-footer {
  margin: 16px 0 0;
  padding-top: 16px;
  border-top: 1px solid #eef2f9;
  font-size: 15px;
  color: #64748b;
  text-align: center;
}
.afps-auth-footer a {
  color: #1c3f9e;
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}
.afps-auth-footer a:hover { color: #16327e; text-decoration: underline; }

@media (max-width: 480px) {
  .afps-auth-gate { padding: 20px 10px; }
  .afps-auth-card { padding: 22px 20px 20px; border-radius: 12px; }
  .afps-auth-title { font-size: 22px; }
}

/* ---- Public document verification page ---- */
.afps-verify { padding: 40px 16px; display: flex; justify-content: center; }
.afps-verify-card {
  width: 100%; max-width: 560px; background: #fff; border: 1px solid #e6e8ec;
  border-radius: 16px; padding: 30px 28px; box-shadow: 0 10px 30px rgba(16,24,40,.06);
}
.afps-verify-brand { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; color: #475467; font-size: 16px; }
.afps-verify-dot { width: 10px; height: 10px; border-radius: 50%; background: #1c3f9e; display: inline-block; }
.afps-verify-title { font-size: 26px; margin: 0 0 6px; color: #101828; }
.afps-verify-intro { color: #667085; font-size: 16px; margin: 0 0 18px; line-height: 1.5; }
.afps-verify-form { display: flex; gap: 8px; margin-bottom: 8px; }
.afps-verify-input {
  flex: 1; padding: 12px 14px; border: 1px solid #d0d5dd; border-radius: 10px;
  font-size: 16px; letter-spacing: 1px; text-transform: uppercase; font-family: ui-monospace, Menlo, Consolas, monospace;
}
.afps-verify-input:focus { outline: none; border-color: #1c3f9e; box-shadow: 0 0 0 3px rgba(28,63,158,.15); }
.afps-verify-btn {
  padding: 12px 20px; border: 0; border-radius: 10px; background: #1c3f9e; color: #fff;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.afps-verify-btn:hover { background: #16327e; }
.afps-verify-result { margin-top: 22px; padding: 20px; border-radius: 12px; border: 1px solid; text-align: center; }
.afps-verify-result--good { background: #ecfdf3; border-color: #a6f4c5; }
.afps-verify-result--warn { background: #fffaeb; border-color: #fedf89; }
.afps-verify-result--bad  { background: #fef3f2; border-color: #fecdca; }
.afps-verify-badge { font-size: 34px; line-height: 1; margin-bottom: 8px; }
.afps-verify-result--good .afps-verify-badge { color: #12b76a; }
.afps-verify-result--warn .afps-verify-badge { color: #f79009; }
.afps-verify-result--bad  .afps-verify-badge { color: #f04438; }
.afps-verify-result h2 { margin: 0 0 6px; font-size: 21px; color: #101828; }
.afps-verify-result p { margin: 0 auto 14px; color: #475467; font-size: 16px; max-width: 42ch; line-height: 1.5; }
.afps-verify-meta { display: grid; grid-template-columns: 1fr; gap: 0; text-align: left; max-width: 360px; margin: 0 auto; }
.afps-verify-meta > div { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid rgba(16,24,40,.08); font-size: 16px; }
.afps-verify-meta dt { color: #667085; margin: 0; }
.afps-verify-meta dd { color: #101828; margin: 0; font-weight: 600; text-align: right; }
@media (max-width: 480px) {
  .afps-verify { padding: 20px 10px; }
  .afps-verify-card { padding: 22px 18px; border-radius: 12px; }
  .afps-verify-form { flex-direction: column; }
}

/* =========================================================================
   Brand typography: Sora for headings, matching the Afritech theme.
   The theme loads the Sora webfont; the stack degrades gracefully without it.
   ========================================================================= */
.afps-portal h1,
.afps-portal h2,
.afps-portal h3,
.afps-portal-header h1,
.afps-auth-title,
.afps-verify-title {
  font-family: "Sora", "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/* =========================================================================
   Public application portal
   ========================================================================= */
body.afps-application-page .afi-container-narrow { max-width: 1180px; }
body.afps-application-page .afi-prose { max-width: none; }
body.afps-application-page .afi-page-hero-slim { display: none; }
body.afps-application-page .afi-section { padding-top: 34px; }
body.afps-application-page .afi-prose > .afps-apply { margin-block: -20px 12px; }
.afps-apply {
  --app-blue: #173c93;
  --app-blue-dark: #0c245c;
  --app-gold: #ffc400;
  --app-ink: #12203a;
  --app-muted: #60708d;
  --app-line: #dbe4f1;
  color: var(--app-ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
.afps-apply *, .afps-apply *::before, .afps-apply *::after { box-sizing: border-box; }
.afps-apply h1, .afps-apply h2, .afps-apply h3, .afps-apply p { margin-top: 0; }
.afps-apply-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 24px;
  padding: 38px 42px;
  border-radius: 24px;
  color: #fff;
  overflow: hidden;
  background:
    radial-gradient(circle at 88% 12%, rgba(255,196,0,.25), transparent 24%),
    linear-gradient(128deg, #0b235a 0%, #173c93 63%, #2451b5 100%);
  box-shadow: 0 22px 50px rgba(12,36,92,.18);
}
.afps-apply-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #e5a900;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .13em;
}
.afps-apply-kicker::before { content: ""; width: 22px; height: 3px; border-radius: 9px; background: currentColor; }
.afps-apply-hero .afps-apply-kicker { color: #ffd84f; }
.afps-apply-hero h1 { margin-bottom: 10px; max-width: 700px; color: #fff; font: 800 clamp(30px, 4vw, 48px)/1.08 "Sora", sans-serif; letter-spacing: -.035em; }
.afps-apply-hero p { margin: 0 auto; max-width: 680px; color: #dbe7ff; font-size: 17px; line-height: 1.65; }
.afps-apply-intake { width: min(100%, 440px); padding: 16px 22px; border: 1px solid rgba(255,255,255,.2); border-radius: 18px; background: rgba(255,255,255,.1); backdrop-filter: blur(8px); }
.afps-apply-intake span, .afps-apply-intake small { display: block; color: #cfddfb; font-size: 12px; }
.afps-apply-intake strong { display: block; margin: 5px 0 8px; color: #fff; font: 700 18px/1.3 "Sora", sans-serif; }
.afps-apply-switcher { display: inline-flex; gap: 4px; margin: 24px 0 18px; padding: 5px; border: 1px solid var(--app-line); border-radius: 13px; background: #f4f7fb; }
.afps-apply-switcher a { padding: 10px 17px; border-radius: 9px; color: #50617e; font-size: 14px; font-weight: 700; text-decoration: none; }
.afps-apply-switcher a.is-active { color: #fff; background: var(--app-blue); box-shadow: 0 5px 12px rgba(23,60,147,.2); }
.afps-apply-workspace { transition: opacity .18s ease, transform .18s ease; }
.afps-apply.is-loading .afps-apply-switcher { cursor: wait; }
.afps-apply.is-loading .afps-apply-switcher a { pointer-events: none; }
.afps-apply.is-loading .afps-apply-workspace { pointer-events: none; opacity: .48; transform: translateY(4px); }
@media (prefers-reduced-motion: reduce) { .afps-apply-workspace { transition: none; } }
.afps-apply-alert { margin-bottom: 18px; padding: 20px 22px; border: 1px solid; border-radius: 16px; }
.afps-apply-alert strong { display: block; margin-bottom: 4px; font: 700 18px/1.3 "Sora", sans-serif; }
.afps-apply-alert p { margin-bottom: 0; color: inherit; }
.afps-apply-alert--error { color: #8a1c18; border-color: #fecaca; background: #fff1f1; }
.afps-apply-alert--success { color: #125c3b; border-color: #a8e5c6; background: #edfff5; }
.afps-app-draft-status { display: flex; align-items: center; gap: 9px; margin: 0 0 14px !important; padding: 11px 14px; border: 1px solid #cbd8eb; border-radius: 11px; color: #50617e; background: #f7faff; font-size: 13px; }
.afps-app-draft-status span { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #2f6ecb; box-shadow: 0 0 0 4px rgba(47,110,203,.12); }
.afps-app-draft-status strong { color: inherit; font-weight: 700; }
.afps-app-draft-status.is-saving span { animation: afps-draft-pulse 1s ease-in-out infinite; }
.afps-app-draft-status.is-saved { border-color: #b9decf; color: #176f52; background: #f0fbf6; }
.afps-app-draft-status.is-saved span { background: #1d9368; box-shadow: 0 0 0 4px rgba(29,147,104,.12); }
.afps-app-draft-status.is-error { border-color: #f2b8b5; color: #8f2a26; background: #fff4f3; }
.afps-app-draft-status.is-error span { background: #c43d37; box-shadow: 0 0 0 4px rgba(196,61,55,.12); }
@keyframes afps-draft-pulse { 50% { opacity: .35; transform: scale(.82); } }
@media (prefers-reduced-motion: reduce) { .afps-app-draft-status.is-saving span { animation: none; } }
.afps-apply-reference { display: inline-flex; align-items: center; gap: 12px; margin: 14px 12px 4px 0; padding: 9px 13px; border-radius: 10px; color: var(--app-ink); background: rgba(255,255,255,.75); }
.afps-apply-reference span { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.afps-apply-reference strong { margin: 0; font-family: ui-monospace, Menlo, Consolas, monospace; }
.afps-apply-form { position: relative; }
.afps-apply-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.afps-apply-progress { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; margin: 0 0 14px !important; padding: 0 !important; list-style: none !important; border: 1px solid var(--app-line); border-radius: 16px; overflow: hidden; background: var(--app-line); }
.afps-apply-progress li { display: flex; align-items: center; gap: 10px; min-width: 0; margin: 0 !important; padding: 13px 16px; color: #6b7890; background: #f8fafc; }
.afps-apply-progress li::before { display: none !important; }
.afps-apply-progress li span { display: grid; flex: 0 0 28px; width: 28px; height: 28px; place-items: center; border: 1px solid #cbd6e6; border-radius: 50%; color: #60708d; background: #fff; font-size: 12px; font-weight: 800; }
.afps-apply-progress li strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.afps-apply-progress li.is-active { color: var(--app-blue); background: #eef4ff; }
.afps-apply-progress li.is-active span { border-color: var(--app-blue); color: #fff; background: var(--app-blue); }
.afps-apply-progress li.is-complete span { border-color: #1f9664; color: #fff; background: #1f9664; }
.afps-apply-panel { border: 1px solid var(--app-line); border-radius: 20px; background: #fff; box-shadow: 0 16px 42px rgba(29,54,100,.09); }
.afps-app-step { padding: clamp(24px, 4vw, 42px); }
.afps-apply-form.is-enhanced .afps-app-step { display: none; }
.afps-apply-form.is-enhanced .afps-app-step.is-active { display: block; animation: afps-app-in .18s ease both; }
@keyframes afps-app-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.afps-app-step-head { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 26px; }
.afps-app-step-head > span { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--app-blue); background: #eaf1ff; font-weight: 800; }
.afps-app-step-head h2 { margin: 0 0 4px; color: var(--app-ink); font: 750 clamp(22px, 2.5vw, 28px)/1.2 "Sora", sans-serif; letter-spacing: -.02em; }
.afps-app-step-head p { margin: 0; color: var(--app-muted); line-height: 1.55; }
.afps-app-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 20px; }
.afps-app-field { display: flex; flex-direction: column; gap: 7px; min-width: 0; margin: 0; color: #34425a; font-size: 14px; font-weight: 700; }
.afps-app-field--wide { grid-column: 1 / -1; }
.afps-app-field > span { color: #34425a; }
.afps-app-field input, .afps-app-field select, .afps-app-field textarea {
  width: 100%; min-height: 47px; margin: 0; padding: 11px 13px; border: 1px solid #ccd7e6; border-radius: 11px; color: var(--app-ink); background: #fff; box-shadow: none; font: 500 15px/1.4 "Inter", sans-serif;
}
.afps-app-field textarea { min-height: 100px; resize: vertical; }
.afps-app-field .flatpickr-wrapper { width: 100%; }
.afps-app-field input.afps-friendly-date {
  padding-right: 46px;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23173c93' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='3'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3Cpath d='M8 14h.01M12 14h.01M16 14h.01M8 18h.01M12 18h.01'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
}
.afps-app-field input.afps-friendly-date:hover { border-color: #9fb4d7; background-color: #fbfdff; }
.afps-app-field input:focus, .afps-app-field select:focus, .afps-app-field textarea:focus { outline: none; border-color: var(--app-blue); box-shadow: 0 0 0 4px rgba(23,60,147,.12); }
.afps-app-field input:disabled { color: #8894a8; background: #f0f3f7; }
.afps-app-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: #34425a; font-size: 14px; cursor: pointer; }
.afps-app-check input { flex: 0 0 auto; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--app-blue); }
.afps-app-check span, .afps-app-check strong, .afps-app-check small { display: block; }
.afps-app-check strong { color: var(--app-ink); }
.afps-app-check small { margin-top: 3px; color: var(--app-muted); line-height: 1.4; }
.afps-app-check--field { align-self: end; min-height: 47px; padding: 10px 12px; border: 1px solid var(--app-line); border-radius: 11px; background: #f8fafc; }
.afps-app-subsection { margin-top: 28px; padding-top: 24px; border-top: 1px solid #e8edf5; }
.afps-app-subsection h3 { margin-bottom: 16px; color: #34425a; font: 700 16px/1.3 "Sora", sans-serif; }
.afps-app-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 30px; padding-top: 22px; border-top: 1px solid #e8edf5; }
.afps-apply-btn { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border: 1px solid transparent; border-radius: 10px; font: 750 14px/1.2 "Inter", sans-serif; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.afps-apply-btn:hover { transform: translateY(-1px); }
.afps-apply-btn:disabled { opacity: .65; cursor: wait; transform: none; }
.afps-apply-btn--primary { color: #fff !important; background: linear-gradient(180deg, #214cae, var(--app-blue)); box-shadow: 0 8px 18px rgba(23,60,147,.2); }
.afps-apply-btn--secondary { color: var(--app-blue) !important; border-color: #cbd7e8; background: #fff; }
.afps-apply-btn--danger { color: #fff !important; background: #a62f2a; }
.afps-app-review { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-bottom: 24px; overflow: hidden; border: 1px solid var(--app-line); border-radius: 13px; background: var(--app-line); }
.afps-app-review > div { min-width: 0; padding: 12px 14px; background: #f8fafc; }
.afps-app-review span, .afps-app-review strong { display: block; }
.afps-app-review span { margin-bottom: 3px; color: var(--app-muted); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.afps-app-review strong { overflow: hidden; color: var(--app-ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.afps-app-consent { margin-top: 20px; padding: 16px; border: 1px solid #cbd8eb; border-radius: 12px; background: #f3f7ff; }
.afps-app-submit-note { display: flex; flex-wrap: wrap; gap: 5px 12px; margin-top: 16px; padding: 13px 15px; border-radius: 10px; color: #654f00; background: #fff8d8; font-size: 13px; }
.afps-track-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.afps-track-layout--form-only { grid-template-columns: minmax(0, 620px); justify-content: center; }
.afps-track-request, .afps-track-files, .afps-track-response { margin-top: 16px; padding: 16px; border: 1px solid var(--app-line); border-radius: 13px; background: #fff; text-align: left; }
.afps-track-request { border-color: #f4cf69; background: #fffaf0; }
.afps-track-request > strong, .afps-track-files > strong { display: block; margin-bottom: 6px; color: var(--app-ink); }
.afps-track-request p { margin: 0; }
.afps-track-files ul { margin: 8px 0 0 !important; padding: 0 !important; list-style: none !important; }
.afps-track-files li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--app-line); }
.afps-track-files small { padding: 2px 8px; border-radius: 99px; background: #eef2ff; color: #274690; font-weight: 700; }
.afps-track-files small.is-accepted { background: #ecfdf3; color: #18794e; }
.afps-track-files small.is-rejected { background: #fff1f2; color: #b42318; }
.afps-track-response summary { cursor: pointer; color: var(--app-blue); font-weight: 800; }
.afps-track-response-form { display: grid; gap: 14px; margin-top: 14px; }
.afps-track-response-form input[type="file"] { padding: 9px; background: #f8fafc; }
.afps-track-pending-email { padding: 10px 12px; border-radius: 9px; background: #eff6ff; color: #1d4ed8; font-size: 13px; }
.afps-track-card, .afps-track-result, .afps-apply-closed { padding: clamp(24px, 4vw, 36px); border: 1px solid var(--app-line); border-radius: 20px; background: #fff; box-shadow: 0 14px 36px rgba(29,54,100,.08); }
.afps-track-card h2, .afps-track-result h2, .afps-apply-closed h2 { color: var(--app-ink); font: 750 24px/1.25 "Sora", sans-serif; letter-spacing: -.02em; }
.afps-track-card > p, .afps-track-result > p, .afps-apply-closed p { color: var(--app-muted); line-height: 1.6; }
.afps-track-form { display: grid; gap: 16px; margin-top: 22px; }
.afps-track-form .afps-apply-btn { width: 100%; }
.afps-track-privacy { margin: 13px 0 0 !important; color: #7b879b !important; font-size: 12px; text-align: center; }
.afps-track-result--missing { text-align: center; }
.afps-track-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 15px; place-items: center; border-radius: 50%; color: #8a6510; background: #fff3c4; font-size: 24px; font-weight: 800; }
.afps-track-status { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.afps-track-status span { padding: 6px 10px; border-radius: 999px; color: #153e83; background: #e8f0ff; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; }
.afps-track-status strong { font-family: ui-monospace, Menlo, Consolas, monospace; }
.afps-track-result dl { margin: 22px 0 0; }
.afps-track-result dl div { display: flex; justify-content: space-between; gap: 14px; padding: 10px 0; border-top: 1px solid #e7edf5; }
.afps-track-result dt { color: var(--app-muted); }
.afps-track-result dd { margin: 0; color: var(--app-ink); font-weight: 700; text-align: right; }
.afps-track-withdraw { margin-top: 20px; padding-top: 16px; border-top: 1px solid #e7edf5; }
.afps-track-withdraw summary { color: #8f2a26; font-weight: 700; cursor: pointer; }
.afps-track-withdraw p { margin: 12px 0; color: var(--app-muted); font-size: 14px; }
.afps-track-withdraw form { display: grid; gap: 13px; }
.afps-apply-closed { text-align: center; }
.afps-apply-closed > span { display: block; margin-bottom: 12px; font-size: 38px; }

@media (max-width: 780px) {
  .afps-apply-hero { padding: 30px 24px; border-radius: 18px; }
  .afps-apply-hero h1 { font-size: clamp(28px, 8vw, 38px); }
  .afps-apply-hero p { font-size: 16px; }
  .afps-apply-progress li { justify-content: center; padding: 11px 7px; }
  .afps-apply-progress li strong { display: none; }
  .afps-app-grid, .afps-app-review, .afps-track-layout { grid-template-columns: 1fr; }
  .afps-app-field--wide { grid-column: auto; }
  .afps-app-actions { justify-content: stretch; }
  .afps-app-actions .afps-apply-btn { flex: 1; }
}

@media (max-width: 480px) {
  body.afps-application-page .afi-section { padding-inline: 14px; }
  body.afps-application-page .afi-prose > .afps-apply { margin-block: -10px 8px; }
  .afps-apply-hero { margin-inline: 0; padding: 26px 18px; border-radius: 16px; }
  .afps-apply-kicker { margin-bottom: 10px; font-size: 11px; }
  .afps-apply-hero h1 { font-size: 28px; }
  .afps-apply-hero p { font-size: 15px; line-height: 1.55; }
  .afps-apply-intake { padding: 14px 16px; border-radius: 14px; }
  .afps-apply-switcher { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
  .afps-apply-switcher a { min-width: 0; padding: 10px 8px; text-align: center; font-size: 13px; }
  .afps-app-step { padding: 22px 17px; }
  .afps-app-step-head { gap: 11px; }
  .afps-app-step-head > span { flex-basis: 36px; width: 36px; height: 36px; }
  .afps-app-actions { flex-direction: column-reverse; }
  .afps-track-status { align-items: flex-start; flex-direction: column; }
}
.afps-result-release{margin:14px 0 22px;border:1px solid #dbe4f0;border-radius:14px;overflow:hidden;background:#fff}.afps-result-release>header{padding:16px 18px;background:linear-gradient(135deg,#eef4ff,#f8fafc);border-bottom:1px solid #dbe4f0}.afps-result-release>header span{font-size:11px;font-weight:800;text-transform:uppercase;letter-spacing:.08em;color:#3156d3}.afps-result-release>header h3{margin:3px 0;font-size:18px}.afps-result-release>header small{color:#64748b}.afps-result-release table{width:100%;border-collapse:collapse}.afps-result-release th,.afps-result-release td{padding:10px 12px;border-bottom:1px solid #edf2f7;text-align:left;font-size:13px}.afps-result-release th{color:#475569;background:#f8fafc;font-size:11px;text-transform:uppercase;letter-spacing:.04em}.afps-result-release>footer{display:flex;justify-content:space-between;gap:12px;padding:13px 18px;background:#f8fafc;color:#334155}.afps-portal-empty{padding:20px;border:1px dashed #cbd5e1;border-radius:12px;background:#f8fafc}.afps-portal-empty h3{margin:0 0 5px}.afps-portal-empty p{margin:0;color:#64748b}@media(max-width:620px){.afps-result-release>footer{display:grid}.afps-result-release .afps-table-wrap{overflow:auto}}
