:root {
  --primary: #d90d62; --heading: #373b4d; --text: #5f666d; --nav: #4a2c4d;
  --panel: #f5f1f2; --line: #e6dfe1; --white: #fff;
  --shadow-sm: 0 1px 2px rgb(55 59 77 / .06), 0 2px 8px rgb(55 59 77 / .05);
  --shadow: 0 1px 3px rgb(55 59 77 / .05), 0 12px 32px -8px rgb(55 59 77 / .14);
  --shadow-lg: 0 2px 6px rgb(55 59 77 / .05), 0 24px 56px -12px rgb(55 59 77 / .22);
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Catamaran, system-ui, sans-serif; font-size: 1.05rem; background: var(--panel); color: var(--text); line-height: 1.6; }
h1, h2, h3 { font-family: Lora, Georgia, serif; color: var(--heading); line-height: 1.3; margin: 0 0 .5rem; overflow-wrap: anywhere; }
h1 { font-size: clamp(1.5rem, 1.1rem + 1.8vw, 2.25rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
a { color: var(--primary); }

header { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .7rem max(1rem, calc((100% - 960px) / 2)); background: var(--white); box-shadow: var(--shadow-sm); }
header .actions { align-items: center; min-width: 0; }
.who { font-weight: 600; color: var(--nav); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.logo { height: 44px; max-width: 100%; object-fit: contain; }
main { max-width: 992px; margin: 0 auto; padding: 1.75rem 1rem 3.5rem; }

/* Layered backdrop: two soft shapes behind a raised card. */
.login { min-height: 100vh; min-height: 100dvh; display: grid; place-items: center; padding: 1.25rem; position: relative; overflow: hidden; isolation: isolate; }
.login::before, .login::after { content: ''; position: absolute; z-index: -1; border-radius: 50%; background: var(--white); box-shadow: var(--shadow); }
.login::before { width: 460px; height: 460px; top: -180px; right: -140px; }
.login::after { width: 320px; height: 320px; bottom: -150px; left: -110px; }
.login .card { width: min(420px, 100%); padding: 0; margin: 0; overflow: hidden; text-align: center; box-shadow: var(--shadow-lg); border-top: 4px solid var(--primary); }
.brand { padding: 2rem 1.5rem 0; }
.brand .logo { height: 56px; }
.brand p { margin: .75rem 0 0; font-size: .8rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; }
.login form { padding: 1.5rem 1.75rem .75rem; text-align: left; }

.card { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 1.5rem; margin-bottom: 1.5rem; box-shadow: var(--shadow); }

.hero { position: relative; overflow: hidden; isolation: isolate; background: var(--white); border: 1px solid var(--line); border-radius: 18px;
  padding: 2rem; margin-bottom: 1.75rem; box-shadow: var(--shadow); }
.hero::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--primary); }
.hero::after { content: ''; position: absolute; z-index: -1; width: 300px; height: 300px; top: -150px; right: -80px; border-radius: 50%; background: var(--panel); }
.hero p { margin: 0; }
.eyebrow { font-size: .75rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--primary); }
.hero .eyebrow { margin-bottom: .35rem; }
.stats { display: flex; gap: .875rem; flex-wrap: wrap; margin: 1.5rem 0 0; }
.stats div { display: flex; flex-direction: column-reverse; flex: 0 1 160px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; padding: .75rem 1rem; box-shadow: var(--shadow-sm); }
.stats dd { margin: 0; font-family: Lora, Georgia, serif; font-size: 1.6rem; font-weight: 700; color: var(--heading); line-height: 1.2; }
.stats dt { font-size: .85rem; font-weight: 600; }

.section-title { margin: 2rem 0 1rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 380px), 1fr)); gap: 1.25rem; margin-bottom: 1.5rem; }
.course { display: flex; flex-direction: column; align-items: flex-start; margin: 0; min-width: 0; transition: transform .2s, box-shadow .2s; }
.course:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.course .list { align-self: stretch; }
.course > .button { margin-top: auto; }
.meta { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1rem; }
.badge { display: inline-block; background: var(--panel); color: var(--nav); border-radius: 99px; padding: .1rem .75rem; font-size: .85rem; font-weight: 600; }
.empty { border: 1px dashed var(--line); border-radius: 12px; background: var(--white); padding: 1.25rem; text-align: center; margin: .75rem 0; }

label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: .75rem; }
input, select { display: block; width: 100%; min-width: 0; min-height: 46px; font: inherit; font-size: 1rem; font-weight: 400; padding: .55rem .8rem; margin-top: .3rem;
  border: 1px solid #d8d0d3; border-radius: 10px; background: var(--white); color: var(--heading); box-shadow: inset 0 1px 2px rgb(55 59 77 / .05); }
input[type="file"] { padding: .45rem; border-style: dashed; }
input::file-selector-button { font: inherit; font-weight: 600; margin-right: .6rem; padding: .2rem .7rem; border: 0; border-radius: 6px; background: var(--panel); color: var(--nav); cursor: pointer; }
button, .button { font: inherit; font-size: .85rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; cursor: pointer; border: 1px solid var(--primary); border-radius: 10px; padding: .5rem 1.15rem; background: var(--primary); color: var(--white);
  text-decoration: none; box-shadow: 0 6px 14px -6px rgb(217 13 98 / .45); transition: transform .15s, filter .15s; }
button:hover, .button:hover { filter: brightness(.93); transform: translateY(-1px); }
button:active, .button:active { transform: none; }
button:disabled { opacity: .6; cursor: wait; }
.secondary { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
:focus-visible { outline: 3px solid var(--nav); outline-offset: 2px; }
.wide { width: 100%; }
.back { display: inline-block; font-weight: 600; text-decoration: none; background: var(--white); border-radius: 99px; padding: .35rem 1rem; box-shadow: var(--shadow-sm); }

.roles { display: flex; gap: .3rem; border: 0; padding: .3rem; margin: 0 0 1.25rem; background: var(--panel); border-radius: 12px; min-width: 0; }
.roles label { flex: 1; margin: 0; text-align: center; border-radius: 9px; padding: .55rem; cursor: pointer; }
.roles input { position: absolute; opacity: 0; width: 1px; min-height: 0; }
.roles label:has(:checked) { background: var(--white); color: var(--primary); box-shadow: var(--shadow-sm); }
.roles label:has(:focus-visible) { outline: 3px solid var(--nav); }

.row { display: flex; gap: .875rem; flex-wrap: wrap; align-items: flex-end; margin-top: .75rem; }
.row > label { flex: 1 1 180px; min-width: 0; margin: 0; }
.list { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; gap: .625rem; }
.list li { display: flex; justify-content: space-between; align-items: center; gap: .75rem; flex-wrap: wrap; padding: .75rem .875rem; border: 1px solid var(--line); border-radius: 12px; background: var(--white); box-shadow: var(--shadow-sm); }
.list li > span:first-child { flex: 1 1 180px; min-width: 0; overflow-wrap: anywhere; font-weight: 600; color: var(--heading); }
.file { display: flex; align-items: center; gap: .7rem; }
.file > span:last-child { min-width: 0; }
.file-icon { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; background: var(--panel); color: var(--primary); font-size: .7rem; font-weight: 700; }
.actions { display: flex; gap: .5rem; flex-wrap: wrap; }
header .actions { flex-wrap: nowrap; }
.error { color: #b00040; font-weight: 600; min-height: 1.5em; margin: .5rem 0 0; }
form:not(.login form) .error:empty { min-height: 0; margin: 0; }
h2 + form + h3, .card h3:not(:first-child) { margin-top: 1.5rem; }

@media (max-width: 600px) {
  main { padding: 1rem .75rem 2.5rem; }
  .logo { height: 36px; }
  .login { padding: .875rem; }
  .login form { padding: 1.25rem 1.1rem .5rem; }
  .card { padding: 1.1rem; margin-bottom: 1rem; }
  .hero { padding: 1.35rem 1.2rem; margin-bottom: 1.25rem; }
  .stats { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: .5rem; margin-top: 1.1rem; }
  .stats div { padding: .6rem .7rem; justify-content: flex-end; }
  .stats dt { font-size: .75rem; line-height: 1.3; }
  .row { flex-direction: column; align-items: stretch; }
  .row > label { flex: none; }
  .row > button, .course > .button { width: 100%; }
  .list li { flex-direction: column; align-items: stretch; }
  .list li > span:first-child { flex: none; }
  .list .actions > *, .list li > button { flex: 1; }
}
@media (max-width: 420px) { .who { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
