:root {
  color-scheme: dark;
  --bg: #05030d;
  --surface: #1d143d;
  --surface-2: #24184c;
  --surface-3: #2b1d5b;
  --hero: #6749b0;
  --hero-2: #7658bd;
  --pink: #f54298;
  --pink-2: #ff61ac;
  --text: #ffffff;
  --muted: #b9afd5;
  --soft: #dacfff;
  --line: rgba(255, 255, 255, 0.09);
  --shadow: 0 22px 55px rgba(0, 0, 0, 0.42);
  --max: 860px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #05030d 0%, #070415 46%, #05030d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a {
  color: inherit;
}

.page {
  width: min(100%, var(--max));
  min-height: 100vh;
  margin: 0 auto;
  padding: 34px clamp(14px, 4vw, 28px) 56px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 26px;
}

.app-header > div:first-child,
.brand-line,
.doc-card,
.mini-card {
  min-width: 0;
}

.student-id {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.brand-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: linear-gradient(135deg, #7b5ff2 0%, #4a2a9f 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.24), 0 12px 26px rgba(79, 50, 170, 0.28);
  color: white;
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-name {
  margin: 0;
  font-size: clamp(26px, 6vw, 38px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.round-action {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: white;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

.round-action.is-user {
  background: #6b4fc3;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: linear-gradient(135deg, var(--hero) 0%, var(--hero-2) 100%);
  box-shadow: var(--shadow);
  padding: clamp(20px, 5vw, 30px);
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: auto 20px 18px 20px;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.23);
}

.hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.hero-label,
.card-kicker,
.section-kicker {
  color: var(--soft);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

.hero-title {
  margin: 4px 0 0;
  color: white;
  font-size: clamp(29px, 8vw, 50px);
  font-weight: 900;
  line-height: 1;
}

.hero-badge {
  flex: 0 0 auto;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 15px;
  font-weight: 900;
  padding: 10px 14px;
}

.hero-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 20px;
  opacity: 0.86;
}

.hero-meta span {
  white-space: nowrap;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 28px;
}

.doc-card,
.mini-card,
.legal-section {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.24);
}

.doc-card {
  min-height: 188px;
  border-radius: 26px;
  padding: 20px;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.doc-card:hover,
.doc-card:focus {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.24);
}

.doc-card.is-accent {
  background: var(--pink);
  color: white;
}

.icon-tile {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 24px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.95);
  color: #24184c;
}

.doc-card:not(.is-accent) .icon-tile,
.mini-card .icon-tile {
  background: #6c54c2;
  color: white;
}

.icon-tile svg {
  width: 22px;
  height: 22px;
}

.doc-card h2,
.mini-card h2 {
  margin: 0 0 5px;
  max-width: 11ch;
  color: white;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
}

.doc-card p,
.mini-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.section-title {
  margin: 34px 0 14px;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.2;
}

.mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.mini-card {
  border-radius: 22px;
  padding: 18px;
}

.mini-card .icon-tile {
  margin-bottom: 18px;
}

.content {
  margin-top: 18px;
}

.summary-card,
.legal-section {
  border-radius: 24px;
  padding: clamp(18px, 4vw, 24px);
}

.summary-card {
  margin: 18px 0 18px;
  background: var(--pink);
  box-shadow: 0 16px 34px rgba(245, 66, 152, 0.22);
}

.summary-card p,
.summary-card strong {
  color: white;
}

.legal-section {
  margin: 14px 0;
}

.legal-section h2 {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: white;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.section-num {
  display: inline-grid;
  flex: 0 0 auto;
  width: 31px;
  height: 31px;
  place-items: center;
  border-radius: 10px;
  background: #6c54c2;
  color: white;
  font-size: 13px;
  font-weight: 900;
}

.legal-section p,
.legal-section li {
  color: var(--muted);
  font-size: 15px;
}

.legal-section p {
  margin: 0 0 10px;
}

.legal-section p:last-child {
  margin-bottom: 0;
}

.legal-section ul {
  margin: 0;
  padding-left: 20px;
}

.legal-section a {
  color: white;
  font-weight: 800;
  text-decoration-color: rgba(245, 66, 152, 0.75);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.doc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0 0;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  background: var(--pink);
  color: white;
  font-size: 14px;
  font-weight: 900;
  padding: 10px 16px;
  text-decoration: none;
}

.button-link.is-secondary {
  background: var(--surface-3);
}

.legal-footer {
  margin-top: 30px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.legal-footer a {
  color: white;
  font-weight: 800;
  text-decoration-color: rgba(255, 255, 255, 0.4);
  text-underline-offset: 4px;
}

@media (max-width: 640px) {
  .page {
    padding-bottom: 36px;
  }

  .app-header {
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 16px;
  }

  .header-actions {
    gap: 5px;
  }

  .round-action {
    width: 32px;
    height: 32px;
    font-size: 13px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .brand-mark svg {
    width: 20px;
    height: 20px;
  }

  .brand-line {
    gap: 9px;
  }

  .brand-name {
    font-size: 24px;
  }

  .student-id {
    font-size: 9px;
    margin-bottom: 7px;
  }

  .hero-card {
    border-radius: 24px;
    padding: 12px;
  }

  .hero-card::after {
    right: 12px;
    bottom: 10px;
    left: 12px;
    height: 9px;
  }

  .hero-top {
    margin-bottom: 12px;
  }

  .hero-label {
    font-size: 11px;
    line-height: 1.1;
  }

  .hero-title {
    font-size: 24px;
  }

  .hero-badge {
    border-radius: 12px;
    font-size: 12px;
    padding: 7px 9px;
  }

  .hero-meta {
    font-size: 10px;
    margin-bottom: 14px;
  }

  .doc-grid,
  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }

  .mini-grid .mini-card:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 430px) {
  .brand-name {
    font-size: 22px;
  }

  .doc-card {
    min-height: 152px;
    padding: 16px;
  }

  .doc-card h2,
  .mini-card h2 {
    font-size: 18px;
  }

  .hero-card {
    border-radius: 24px;
  }
}
