/* AutoSchools V2.0.54 — Mini App UX reset.
   Registration is a first-class state; workspace UI appears only after role resolution. */

:root {
  --ux-page-gap: 18px;
  --ux-card-radius: 22px;
  --ux-control-height: 54px;
}

.app {
  padding-inline: 14px;
  padding-top: calc(8px + env(safe-area-inset-top));
}

.brand-rail {
  min-height: 62px;
  margin-bottom: 16px;
  padding: 9px 11px;
  border-radius: 20px;
}
.brand-rail .topbar-logo { width: 42px; height: 42px; }
.brand-rail .brand-copy h1 { font-size: 21px; letter-spacing: -.45px; }
.brand-rail .brand-copy .eyebrow { font-size: 10.5px; }
.brand-notifications { width: 40px; height: 40px; flex-basis: 40px; border-radius: 13px; }
.brand-rail .language-trigger { min-width: 58px; height: 42px; border-radius: 13px; }

.section-head {
  margin: 20px 2px 12px;
  align-items: center;
}
.section-head h2 { font-size: 24px; letter-spacing: -.03em; }

/* ---------- Registration gate ---------- */
html.as-registration-gate .app {
  width: min(100%, 540px);
  padding-bottom: calc(22px + env(safe-area-inset-bottom));
}
html.as-registration-gate .brand-rail {
  min-height: 48px;
  margin-bottom: 10px;
  padding: 4px 2px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
html.as-registration-gate .brand-rail .topbar-logo { width: 36px; height: 36px; }
html.as-registration-gate .brand-rail .brand-copy .eyebrow { display: none; }
html.as-registration-gate .brand-rail .brand-copy h1 { font-size: 18px; }
html.as-registration-gate .brand-notifications { display: none !important; }
html.as-registration-gate .brand-rail .language-trigger {
  min-width: 54px;
  height: 38px;
  background: rgba(7,18,39,.66);
}
html.as-registration-gate #view-profile > .section-head,
html.as-registration-gate #view-home,
html.as-registration-gate .bottom-nav,
html.as-registration-gate #app-menu { display: none !important; }
html.as-registration-gate #view-profile.active { display: block; padding-top: 0; }
html.as-registration-gate #profile-list { display: block; }
html.as-registration-gate .profile-context-head { display: none; }

.registration-entry,
.registration-wizard,
.student-join-shell,
.registration-status-shell {
  width: 100%;
  max-width: 510px;
  margin: 0 auto;
}

.registration-entry--v2054 { display: grid; gap: 12px; }
.registration-entry-head {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 13px;
  align-items: start;
  padding: 12px 4px 16px;
}
.registration-entry-mark,
.registration-wizard-icon,
.registration-status-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid rgba(76,157,255,.38);
  background: linear-gradient(145deg, rgba(16,77,166,.44), rgba(5,25,61,.72));
  color: #69bdff;
  box-shadow: inset 0 1px rgba(255,255,255,.06), 0 10px 28px rgba(0,75,180,.16);
}
.registration-entry-mark .as-icon,
.registration-wizard-icon .as-icon,
.registration-status-icon .as-icon { width: 24px; height: 24px; }
.registration-entry-head h2,
.registration-status-shell h2 {
  margin: 2px 0 7px;
  font-size: clamp(27px, 7.2vw, 34px);
  line-height: 1.03;
  letter-spacing: -.045em;
}
.registration-entry-head > div > p:last-child,
.registration-status-lead {
  color: rgba(224,235,251,.68);
  font-size: 14px;
  line-height: 1.48;
}

.registration-role-grid { display: grid; gap: 10px; }
.registration-role-card {
  width: 100%;
  min-height: 96px;
  display: grid;
  grid-template-columns: 48px minmax(0,1fr) 22px;
  align-items: center;
  gap: 12px;
  padding: 14px;
  color: inherit;
  text-align: left;
  border: 1px solid rgba(121,173,244,.23);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(10,28,60,.86), rgba(4,14,32,.88));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 12px 30px rgba(0,0,0,.16);
}
.registration-role-card:active { transform: scale(.985); border-color: rgba(69,153,255,.58); }
.registration-role-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: rgba(17,55,111,.54);
  border: 1px solid rgba(71,151,255,.35);
  color: #65baff;
}
.registration-role-icon .as-icon { width: 24px; height: 24px; }
.registration-role-copy { min-width: 0; display: grid; gap: 4px; }
.registration-role-copy strong { font-size: 18px; line-height: 1.12; color: #fff; }
.registration-role-copy small { color: rgba(220,232,250,.65); font-size: 12.5px; line-height: 1.35; }
.registration-role-copy b { margin-top: 2px; color: #6bbaff; font-size: 12.5px; font-weight: 720; }
.registration-role-chevron { color: rgba(218,235,255,.72); }
.registration-role-chevron .as-icon { width: 20px; height: 20px; }

.registration-network-link {
  margin: 0;
  min-height: 58px;
  padding: 10px 14px;
  border-radius: 18px;
  background: rgba(5,17,39,.62);
}
.registration-network-link > span:nth-child(2) { display: grid; gap: 2px; }
.registration-network-link strong { font-size: 14px; }
.registration-network-link small { color: rgba(218,231,251,.58); font-size: 11.5px; font-weight: 500; }
.registration-entry-secondary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px 0;
  color: rgba(213,228,249,.6);
  font-size: 12px;
}
.registration-entry-secondary button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 0 8px 12px;
  color: #6dbbff;
  background: transparent;
  font-weight: 700;
}
.registration-entry-secondary .as-icon { width: 16px; height: 16px; }

/* Wizard: no overlaying sticky CTA. */
.registration-wizard--v2054 { display: grid; gap: 14px; }
.registration-wizard-head {
  display: grid;
  grid-template-columns: 46px minmax(0,1fr);
  gap: 13px;
  align-items: center;
  padding: 8px 4px 0;
}
.registration-wizard-copy { min-width: 0; }
.registration-wizard-copy h2 {
  margin: 2px 0 3px;
  font-size: clamp(25px, 6.8vw, 31px);
  line-height: 1.05;
  letter-spacing: -.04em;
}
.registration-wizard-copy > p:last-child { color: rgba(218,231,251,.58); font-size: 12px; }
.registration-wizard .onboarding-progress {
  height: 5px;
  margin: 0 4px;
  border: 0;
  background: rgba(255,255,255,.10);
}
.registration-wizard .onboarding-counter { display: none; }
.registration-form-card {
  padding: 18px 16px;
  border: 1px solid rgba(121,173,244,.23);
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(9,25,54,.84), rgba(4,13,30,.88));
  box-shadow: inset 0 1px rgba(255,255,255,.04), 0 14px 36px rgba(0,0,0,.16);
}
.registration-form-card .onboarding-body { gap: 16px; }
.registration-form-card .form-grid { gap: 14px; margin-top: 0; }
.registration-form-card .field-label {
  display: grid;
  gap: 7px;
  color: rgba(239,246,255,.9);
  font-size: 13px;
  line-height: 1.25;
}
.registration-form-card .field,
.registration-form-card .select,
.student-join-shell .field {
  min-height: var(--ux-control-height);
  padding-inline: 15px;
  border-radius: 17px;
  font-size: 16px;
}
.registration-form-card textarea.field { min-height: 108px; padding-block: 13px; }
.registration-form-card .button-grid { gap: 9px; }
.registration-form-card .card,
.registration-form-card .notice { margin: 0; }
.onboarding-actions--v2054 {
  position: static;
  bottom: auto;
  z-index: auto;
  grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr);
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
}
.onboarding-actions--v2054 .button,
.onboarding-actions--v2054 .tiny-button {
  min-height: 54px;
  border-radius: 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.onboarding-actions--v2054 .as-icon { width: 18px; height: 18px; }
.onboarding-actions--v2054 .tiny-button .as-icon { transform: rotate(180deg); }

.student-join-shell { gap: 12px; }
.student-join-shell .onboarding-hero {
  margin: 0;
  padding: 14px 4px 10px;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.student-join-shell .student-join-card,
.student-join-shell .student-join-preview { border-radius: 22px; }
.student-join-shell > .tiny-button.wide { min-height: 50px; border-radius: 17px; }

.registration-status-shell {
  display: grid;
  gap: 12px;
  padding: 18px 4px;
}
.registration-status-shell .registration-status-icon { margin-bottom: 2px; }
.registration-status-card {
  display: grid;
  gap: 4px;
  margin-top: 6px;
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(96,164,255,.28);
  background: rgba(8,25,57,.72);
}
.registration-status-card small { color: rgba(218,232,252,.58); }
.registration-status-card strong { font-size: 18px; }
.registration-status-card span { color: #69baff; font-size: 12px; }
.registration-status-actions { display: grid; gap: 10px; margin-top: 4px; }
.registration-status-actions .button { display:flex; align-items:center; justify-content:center; gap:8px; min-height:52px; border-radius:17px; }
.registration-status-actions .as-icon { width:18px; height:18px; }

/* Catalog preview stays deliberately limited before registration. */
.registration-preview-banner {
  display: none;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 11px 12px;
  border-radius: 16px;
  border: 1px solid rgba(75,153,255,.3);
  background: rgba(7,27,60,.78);
  color: rgba(230,240,255,.82);
  font-size: 12px;
  line-height: 1.35;
}
.registration-preview-banner .as-icon { width: 18px; height: 18px; color: #65baff; flex: 0 0 auto; }
html.as-registration-preview .registration-preview-banner { display: flex; }
html.as-registration-preview #view-market { padding-bottom: 18px; }

/* ---------- Resolved workspace ---------- */
html.as-workspace-ready .role-hero {
  padding: 17px 15px 15px;
  border-radius: 24px;
}
html.as-workspace-ready .role-hero-top {
  grid-template-columns: minmax(0,1fr);
  min-height: 124px;
}
html.as-workspace-ready .role-hero-visual {
  position: absolute;
  inset: 0 0 auto auto;
  width: 48%;
  height: 158px;
  opacity: .5;
  pointer-events: none;
}
html.as-workspace-ready .role-hero-copy { width: 66%; position: relative; z-index: 2; }
html.as-workspace-ready .role-hero h2 { font-size: clamp(25px, 6.8vw, 32px); }
html.as-workspace-ready .role-subtitle { display: none; }
html.as-workspace-ready .role-identity { margin-top: 10px; }
html.as-workspace-ready .role-metrics { gap: 7px; margin-top: 12px; }
html.as-workspace-ready .role-metric { min-height: 72px; padding: 9px 8px; border-radius: 16px; }
html.as-workspace-ready .role-metric-copy strong { font-size: 17px; }
html.as-workspace-ready .role-metric-copy small { font-size: 9.5px; line-height: 1.18; }
html.as-workspace-ready .role-hero-primary { min-height: 50px; margin-top: 11px; border-radius: 17px; }
html.as-workspace-ready .role-apps-head { margin-top: 22px; }
html.as-workspace-ready .role-apps-head h2 { font-size: 21px; }
html.as-workspace-ready #home-apps-grid.app-widget-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
html.as-workspace-ready #home-apps-grid .app-widget {
  min-height: 108px;
  padding: 13px;
  border-radius: 19px;
}
html.as-workspace-ready #home-apps-grid .app-widget-icon { width: 42px; height: 42px; flex-basis: 42px; border-radius: 13px; }
html.as-workspace-ready #home-apps-grid .app-widget-icon .as-icon { width: 22px !important; height: 22px !important; }
html.as-workspace-ready #home-apps-grid .app-widget-head strong { font-size: 15px; line-height: 1.12; }
html.as-workspace-ready #home-apps-grid .app-widget-copy { display: none; }
html.as-workspace-ready #home-apps-grid .app-widget::after { width: 27px; height: 27px; right: 11px; bottom: 11px; font-size: 15px; }
html.as-workspace-ready .role-glance { margin-top: 11px; border-radius: 18px; }

/* Generic page rhythm: one spacing system for the whole Mini App. */
html.as-workspace-ready .section.active:not(#view-home):not(#view-ai) { padding-top: 2px; }
.card, .details, .notice, .empty { max-width: 100%; }
.field-label { min-width: 0; }

@media (max-width: 390px) {
  .app { padding-inline: 12px; }
  .registration-entry-head { grid-template-columns: 42px minmax(0,1fr); gap: 11px; }
  .registration-entry-mark,
  .registration-wizard-icon,
  .registration-status-icon { width: 42px; height: 42px; border-radius: 14px; }
  .registration-role-card { min-height: 92px; padding: 12px; grid-template-columns: 44px minmax(0,1fr) 18px; gap: 10px; }
  .registration-role-icon { width:44px; height:44px; border-radius:14px; }
  .registration-role-copy strong { font-size: 17px; }
  .registration-role-copy small { font-size: 12px; }
  .registration-wizard-head { grid-template-columns: 42px minmax(0,1fr); gap: 11px; }
  .registration-form-card { padding: 16px 13px; }
  html.as-workspace-ready .role-hero-copy { width: 72%; }
  html.as-workspace-ready .role-hero-visual { width: 52%; opacity: .42; }
}

@media (max-width: 350px) {
  .registration-entry-head h2,
  .registration-status-shell h2 { font-size: 25px; }
  .registration-entry-secondary { align-items: flex-start; flex-direction: column; gap: 0; }
  .registration-entry-secondary button { padding-left: 0; }
  .onboarding-actions--v2054 { grid-template-columns: 1fr; }
  html.as-workspace-ready #home-apps-grid.app-widget-grid { grid-template-columns: 1fr; }
  html.as-workspace-ready #home-apps-grid .app-widget { min-height: 92px; }
}

.context-loading-shell {
  min-height: 118px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(115,171,247,.22);
  background: rgba(6,20,45,.72);
}
.context-loading-shell > span {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #66b9ff;
  background: rgba(20,77,157,.36);
}
.context-loading-shell .as-icon { width: 23px; height: 23px; }
.context-loading-shell div { display: grid; gap: 4px; }
.context-loading-shell strong { font-size: 18px; }
.context-loading-shell small { color: rgba(220,232,251,.62); font-size: 12.5px; }
