:root {
    --sg-burgundy-950: #260510;
    --sg-burgundy-900: #3a081d;
    --sg-burgundy-800: #560d2b;
    --sg-burgundy-700: #741a3b;
    --sg-burgundy-600: #991f50;
    --sg-rose: #d84d82;
    --sg-ink: #24141d;
    --sg-muted: #7c6f75;
    --sg-line: #eadde2;
    --sg-white: #fff;
    --sg-shadow: 0 28px 74px rgba(29, 2, 14, .28);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.sg-body {
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    color: var(--sg-ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
    background:
        radial-gradient(circle at 10% 13%, rgba(217, 64, 120, .30), transparent 27%),
        radial-gradient(circle at 88% 72%, rgba(117, 26, 59, .34), transparent 31%),
        linear-gradient(135deg, #250612 0%, #3c0a20 45%, #240711 100%);
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; }
svg { display: block; }

.sg-bg-shape,
.sg-bg-lines { position: fixed; inset: auto; pointer-events: none; z-index: 0; }
.sg-bg-shape { border-radius: 999px; filter: blur(.2px); }
.sg-bg-shape-a {
    width: 610px; height: 610px; left: -280px; top: -270px;
    background: linear-gradient(145deg, rgba(214,63,118,.24), rgba(255,255,255,.02));
    transform: rotate(18deg);
}
.sg-bg-shape-b {
    width: 520px; height: 520px; right: -260px; bottom: -250px;
    border: 1px solid rgba(255,255,255,.06);
    box-shadow: inset 0 0 0 80px rgba(255,255,255,.018);
}
.sg-bg-lines {
    right: -2%; top: 0; width: 48vw; height: 48vh; opacity: .13;
    background: repeating-radial-gradient(ellipse at 100% 0%, transparent 0 19px, rgba(255,255,255,.18) 20px 21px);
}

.sg-enterprise-shell {
    position: relative;
    z-index: 1;
    width: min(1120px, calc(100% - 56px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 34px 0;
    display: grid;
    grid-template-columns: minmax(380px, 410px) minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.sg-login-card,
.sg-experience-column {
    min-height: 630px;
}

/* Stage 85.1: keep the sign-in card content-driven. Django flash messages
   (for example the signed-out confirmation) must expand the card instead
   of pushing the security assurance into the lower edge. */
.sg-login-card {
    height: auto;
    min-height: clamp(630px, 82vh, 720px);
}
.sg-experience-column {
    height: clamp(630px, 82vh, 720px);
}

/* LEFT LOGIN */
.sg-login-card {
    display: flex;
    flex-direction: column;
    padding: 34px 34px 24px;
    border-radius: 22px;
    background: linear-gradient(180deg, #ffffff 0%, #fffafb 100%);
    border: 1px solid rgba(255,255,255,.9);
    box-shadow: var(--sg-shadow);
}
.sg-wordmark { text-align: center; }
.sg-wordmark-mark {
    width: 44px; height: 44px; margin: 0 auto 5px;
    display: grid; place-items: center; color: #8d1744;
}
.sg-wordmark-mark svg { width: 44px; height: 44px; fill: currentColor; }
.sg-wordmark-mark .sg-star { fill: #b42e60; }
.sg-wordmark > strong {
    display: block; color: #8b153f; font-size: 31px; line-height: 1;
    font-weight: 900; letter-spacing: -1.7px;
}
.sg-wordmark > small {
    display: block; margin-top: 7px; color: #6e6066; font-size: 9px;
    font-weight: 800; letter-spacing: .25px;
}

.sg-login-heading { margin-top: 31px; text-align: center; }
.sg-login-heading > span { color: #aa6d83; font-size: 9px; font-weight: 900; letter-spacing: 1.8px; }
.sg-login-heading h1 { margin: 7px 0 6px; color: #24151c; font-size: 23px; line-height: 1.15; letter-spacing: -.75px; }
.sg-login-heading p { margin: 0 auto; max-width: 310px; color: #8a7c82; font-size: 9px; line-height: 1.5; }

.sg-messages { margin-top: 16px; }
.sg-message { display: flex; align-items: center; gap: 9px; padding: 10px 11px; border: 1px solid #f0d5df; border-radius: 10px; background: #fff3f6; color: #76364c; }
.sg-message.success { border-color: #ccefdc; background: #effbf5; color: #23694f; }
.sg-message > span { width: 22px; height: 22px; flex: 0 0 22px; display: grid; place-items: center; border-radius: 50%; background: rgba(255,255,255,.85); font-weight: 900; font-size: 9px; }
.sg-message p { margin: 0; font-size: 9px; font-weight: 700; line-height: 1.35; }

.sg-login-form { margin-top: 25px; }
.sg-field { display: block; margin-bottom: 14px; }
.sg-field > span:first-child { display: block; margin-bottom: 7px; color: #3c3035; font-size: 9px; font-weight: 850; }
.sg-input-shell {
    min-height: 54px; display: flex; align-items: center; gap: 11px; padding: 0 14px;
    border: 1px solid #e4d8dc; border-radius: 12px; background: #fff;
    box-shadow: 0 8px 20px rgba(95, 20, 51, .035);
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.sg-input-shell:focus-within { border-color: #b44a70; box-shadow: 0 0 0 4px rgba(152,31,80,.08); transform: translateY(-1px); }
.sg-input-shell > svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: #a24065; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.sg-input-shell input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: #25171d; font-size: 11px; }
.sg-input-shell input::placeholder { color: #b2a5aa; }
.sg-eye { width: 31px; height: 31px; margin-left: auto; display: grid; place-items: center; border: 0; border-radius: 8px; color: #9c7483; background: transparent; cursor: pointer; }
.sg-eye:hover { color: #781e40; background: #fbf4f6; }
.sg-eye svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sg-eye .eye-closed { display: none; }
.sg-eye.showing .eye-open { display: none; }
.sg-eye.showing .eye-closed { display: block; }
.sg-form-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 1px 0 14px; }
.sg-remember { display: inline-flex; align-items: center; gap: 7px; color: #675a5f; font-size: 9px; cursor: pointer; }
.sg-remember input { position: absolute; opacity: 0; pointer-events: none; }
.sg-remember > span { width: 17px; height: 17px; position: relative; border: 1px solid #d8cbd0; border-radius: 5px; background: #fff; }
.sg-remember input:checked + span { border-color: #8a2047; background: #8a2047; }
.sg-remember input:checked + span::after { content: "✓"; position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 10px; font-weight: 900; }
.sg-protected { display: inline-flex; align-items: center; gap: 7px; color: #846f77; font-size: 8px; font-weight: 700; }
.sg-protected i { width: 7px; height: 7px; border-radius: 50%; background: #37b582; box-shadow: 0 0 0 4px rgba(55,181,130,.11); }

.sg-signin {
    width: 100%; min-height: 54px; position: relative; display: flex; align-items: center; justify-content: center; gap: 11px;
    overflow: hidden; border: 0; border-radius: 12px; color: #fff;
    background: linear-gradient(100deg, #6f1038 0%, #8b1745 46%, #ad265b 100%);
    box-shadow: 0 15px 28px rgba(126,24,65,.2); cursor: pointer; font-size: 11px; font-weight: 850;
    transition: transform .18s ease, box-shadow .18s ease;
}
.sg-signin:hover { transform: translateY(-1px); box-shadow: 0 18px 34px rgba(126,24,65,.27); }
.sg-signin b { position: absolute; right: 18px; font-size: 20px; font-weight: 400; transition: transform .18s ease; }
.sg-signin:hover b { transform: translateX(3px); }
.sg-signin:disabled { cursor: wait; opacity: .84; transform: none; }
.sg-spinner { display: none; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; border-radius: 50%; animation: sg-spin .75s linear infinite; }
.sg-signin.loading b { display: none; }
.sg-signin.loading .sg-spinner { display: block; }
@keyframes sg-spin { to { transform: rotate(360deg); } }

.sg-login-assurance { margin-top: 24px; display: flex; align-items: center; gap: 10px; padding: 13px; border-radius: 12px; background: #fbf6f8; border: 1px solid #f1e6ea; }
.sg-assurance-icon { width: 31px; height: 31px; flex: 0 0 31px; display: grid; place-items: center; border-radius: 9px; color: #8d405d; background: #fff; }
.sg-assurance-icon svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sg-login-assurance strong, .sg-login-assurance small { display: block; }
.sg-login-assurance strong { color: #67555c; font-size: 8px; }
.sg-login-assurance small { margin-top: 2px; color: #9e9096; font-size: 7px; line-height: 1.3; }
.sg-login-footer { margin-top: 18px; padding-bottom: 2px; display: flex; justify-content: space-between; gap: 12px; color: #ab9ea3; font-size: 7px; }

/* RIGHT EXPERIENCE */
.sg-experience-column {
    min-width: 0;
    display: grid;
    grid-template-rows: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: 18px;
}

.sg-carousel {
    position: relative; min-height: 0; overflow: hidden; border-radius: 22px;
    border: 1px solid rgba(255,255,255,.15); background: #2c0b19;
    box-shadow: var(--sg-shadow);
}
.sg-carousel-track, .sg-slide { position: absolute; inset: 0; }
.sg-slide { opacity: 0; visibility: hidden; transition: opacity .85s ease, visibility .85s ease; }
.sg-slide.is-active { opacity: 1; visibility: visible; }
.sg-slide img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center center; transform: scale(1.012); transition: transform 7s linear; }
.sg-slide.is-active img { transform: scale(1.045); }
.sg-slide-award img { object-position: 50% 30%; }
.sg-slide-shade {
    position: absolute; inset: 0;
    background: linear-gradient(90deg, rgba(21,5,12,.66) 0%, rgba(38,7,20,.44) 30%, rgba(31,7,17,.10) 66%, rgba(31,7,17,.03) 100%);
}
.sg-slide-shade::after { content: ""; position: absolute; inset: auto 0 0; height: 34%; background: linear-gradient(transparent, rgba(20,5,12,.24)); }
.sg-slide-copy { position: absolute; left: clamp(28px, 4vw, 44px); bottom: clamp(26px, 4vh, 38px); width: min(54%, 410px); color: #fff; }
.sg-slide-copy > span { display: inline-block; margin-bottom: 7px; color: rgba(255,221,233,.88); font-size: 7px; font-weight: 850; letter-spacing: 1.45px; }
.sg-slide-copy h2 { margin: 0; font-size: clamp(23px, 2.25vw, 33px); line-height: 1.06; letter-spacing: -1.05px; font-weight: 850; text-shadow: 0 3px 18px rgba(0,0,0,.24); }
.sg-slide-copy p { margin: 9px 0 0; max-width: 390px; color: rgba(255,255,255,.72); font-size: 9px; line-height: 1.5; }

.sg-carousel-arrow {
    position: absolute; z-index: 4; top: 50%; transform: translateY(-50%);
    width: 38px; height: 38px; display: grid; place-items: center;
    border: 1px solid rgba(255,255,255,.28); border-radius: 50%;
    color: #fff; background: rgba(50,8,26,.28); backdrop-filter: blur(12px);
    cursor: pointer; font-size: 24px; line-height: 1; opacity: .62;
    transition: opacity .18s ease, background .18s ease, transform .18s ease;
}
.sg-carousel:hover .sg-carousel-arrow { opacity: .95; }
.sg-carousel-arrow:hover { background: rgba(101,18,51,.58); }
.sg-carousel-prev { left: 15px; }
.sg-carousel-next { right: 15px; }
.sg-carousel-dots { position: absolute; z-index: 5; right: 22px; bottom: 19px; display: flex; gap: 7px; }
.sg-carousel-dots button { width: 7px; height: 7px; padding: 0; border: 0; border-radius: 999px; background: rgba(255,255,255,.45); cursor: pointer; transition: width .2s ease, background .2s ease; }
.sg-carousel-dots button.is-active { width: 25px; background: #fff; }

/* TRANSPARENT / GLASS PORTALS — open, lighter treatment */
.sg-portals-panel {
    min-height: 0; padding: 8px 0 0;
    display: flex; flex-direction: column;
    overflow: visible; border-radius: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.sg-portals-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 10px; padding: 0 2px; color: #fff; }
.sg-portals-heading span { display: block; margin-bottom: 3px; color: rgba(246,194,213,.80); font-size: 7px; font-weight: 850; letter-spacing: 1.45px; }
.sg-portals-heading h2 { margin: 0; font-size: 18px; line-height: 1.1; letter-spacing: -.5px; font-weight: 800; }
.sg-portals-heading p { margin: 0; max-width: 230px; color: rgba(255,255,255,.50); font-size: 7px; line-height: 1.45; text-align: right; }

.sg-portals { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 10px; }
.sg-portal-card {
    min-width: 0; min-height: 0; position: relative;
    display: grid; grid-template-columns: 39px minmax(0, 1fr) 27px; align-items: center; gap: 10px;
    padding: 13px 14px; overflow: hidden;
    border: 1px solid rgba(255,255,255,.16); border-radius: 15px;
    color: #fff;
    background: linear-gradient(125deg, rgba(255,255,255,.105), rgba(255,255,255,.045));
    box-shadow: inset 0 1px 0 rgba(255,255,255,.06), 0 8px 20px rgba(20,0,9,.09);
    backdrop-filter: blur(15px) saturate(115%);
    -webkit-backdrop-filter: blur(15px) saturate(115%);
    transition: transform .18s ease, border-color .18s ease, background .18s ease, box-shadow .18s ease;
}
.sg-portal-card::before { content: ""; position: absolute; inset: 0; background: linear-gradient(115deg, rgba(255,255,255,.04), transparent 44%); pointer-events: none; }
.sg-portal-card:hover, .sg-portal-card:focus-visible { transform: translateY(-2px); border-color: rgba(255,255,255,.30); background: linear-gradient(125deg, rgba(255,255,255,.145), rgba(255,255,255,.07)); box-shadow: inset 0 1px 0 rgba(255,255,255,.09), 0 12px 26px rgba(20,0,9,.14); outline: none; }
.sg-portal-icon { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: rgba(255,255,255,.90); box-shadow: 0 5px 14px rgba(21,4,11,.08); }
.sg-portal-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.sg-portal-copy { min-width: 0; }
.sg-portal-copy strong, .sg-portal-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sg-portal-copy strong { color: rgba(255,255,255,.96); font-size: 9px; line-height: 1.25; }
.sg-portal-copy small { margin-top: 3px; color: rgba(255,255,255,.54); font-size: 6.5px; line-height: 1.2; }
.sg-portal-arrow { width: 27px; height: 27px; display: grid; place-items: center; border-radius: 50%; border: 1px solid rgba(255,255,255,.15); color: rgba(255,255,255,.76); background: rgba(255,255,255,.035); font-size: 13px; transition: transform .18s ease, background .18s ease; }
.sg-portal-card:hover .sg-portal-arrow { transform: translateX(2px); background: rgba(255,255,255,.09); }
.sg-learning .sg-portal-icon { color: #8a2f57; }
.sg-staff .sg-portal-icon { color: #6f48a8; }
.sg-student .sg-portal-icon { color: #277c4d; }
.sg-parent .sg-portal-icon { color: #cc6d14; }

@media (max-height: 780px) and (min-width: 981px) {
    .sg-enterprise-shell { padding-top: 24px; padding-bottom: 24px; }
    .sg-login-card, .sg-experience-column { height: 620px; min-height: 620px; }
    .sg-login-card { padding: 25px 30px 20px; }
    .sg-login-heading { margin-top: 22px; }
    .sg-login-form { margin-top: 19px; }
    .sg-field { margin-bottom: 11px; }
    .sg-input-shell, .sg-signin { min-height: 49px; }
    .sg-portals-panel { padding: 5px 0 0; }
    .sg-portals-heading { margin-bottom: 10px; }
    .sg-portal-card { padding: 10px 12px; }
    .sg-portal-icon { width: 38px; height: 38px; }
}

@media (max-width: 1080px) {
    .sg-enterprise-shell { width: min(1120px, calc(100% - 36px)); grid-template-columns: minmax(320px, 360px) minmax(0,1fr); gap: 18px; }
    .sg-login-card { padding-left: 27px; padding-right: 27px; }
    .sg-slide-copy { width: 58%; }
}

@media (max-width: 980px) {
    body.sg-body { overflow-y: auto; }
    .sg-enterprise-shell { width: min(760px, calc(100% - 32px)); min-height: auto; padding: 24px 0 30px; display: block; }
    .sg-login-card, .sg-experience-column { height: auto; min-height: 0; }
    .sg-login-card { min-height: 610px; }
    .sg-experience-column { margin-top: 20px; display: block; }
    .sg-carousel { height: 430px; }
    .sg-portals-panel { margin-top: 18px; min-height: 330px; }
}

@media (max-width: 640px) {
    .sg-enterprise-shell { width: min(100% - 22px, 560px); padding: 12px 0 22px; }
    .sg-login-card { min-height: auto; padding: 26px 20px 30px; border-radius: 18px; }
    .sg-login-heading { margin-top: 25px; }
    .sg-login-heading p { font-size: 8px; }
    .sg-login-assurance { margin-top: 26px; }
    .sg-login-footer { margin-top: 18px; padding-bottom: 0; }
    .sg-carousel { height: 390px; border-radius: 18px; }
    .sg-slide-copy { left: 24px; right: 24px; bottom: 30px; width: auto; }
    .sg-slide-copy h2 { font-size: 26px; }
    .sg-slide-copy p { font-size: 8px; }
    .sg-carousel-arrow { width: 34px; height: 34px; }
    .sg-portals-panel { padding: 8px 0 0; min-height: 0; border-radius: 0; }
    .sg-portals-heading { display: block; }
    .sg-portals-heading p { margin-top: 5px; text-align: left; }
    .sg-portals { margin-top: 2px; grid-template-columns: 1fr; grid-template-rows: none; }
    .sg-portal-card { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
    .sg-slide img { transform: none !important; }
}


/* Stage 85.1 — stable flash-message layout */
.sg-messages + .sg-login-form { margin-top: 20px; }
@media (max-width: 640px) {
    .sg-messages { margin-top: 14px; }
    .sg-messages + .sg-login-form { margin-top: 18px; }
}
