:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17233d;
  background: #eef3fb;
  font-synthesis: none;
  --navy: #102a63;
  --blue: #2558d9;
  --blue-dark: #1744bb;
  --ink: #17233d;
  --muted: #69758d;
  --line: #dce3ef;
  --danger: #b4233f;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 15% 15%, rgba(79, 125, 237, 0.13), transparent 30%),
    radial-gradient(circle at 85% 80%, rgba(79, 125, 237, 0.1), transparent 28%),
    #eef3fb;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1120px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 0 24px;
  display: grid;
  align-content: center;
  gap: 24px;
}

.auth-card {
  min-height: 650px;
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(480px, 1.08fr);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(19, 47, 104, 0.08);
  border-radius: 28px;
  box-shadow: 0 28px 70px rgba(30, 55, 105, 0.15);
}

.brand-panel {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  padding: 48px;
  color: #fff;
  background:
    linear-gradient(145deg, rgba(20, 53, 126, 0.96), rgba(20, 65, 170, 0.95)),
    var(--navy);
}

.brand-panel::before,
.brand-panel::after {
  content: "";
  position: absolute;
  z-index: -1;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.brand-panel::before {
  width: 390px;
  height: 390px;
  top: -145px;
  right: -180px;
  box-shadow: 0 0 0 55px rgba(255, 255, 255, 0.025), 0 0 0 110px rgba(255, 255, 255, 0.018);
}

.brand-panel::after {
  width: 240px;
  height: 240px;
  bottom: -120px;
  left: -105px;
  box-shadow: 0 0 0 45px rgba(255, 255, 255, 0.025);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 17px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  color: #1c4cb8;
  background: #fff;
  box-shadow: 0 8px 24px rgba(1, 17, 56, 0.2);
}

.brand-mark svg {
  width: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.brand-copy {
  margin: auto 0;
  padding: 60px 0;
}

.eyebrow {
  margin: 0 0 15px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.15em;
}

.brand-copy .eyebrow {
  color: #b9cdfd;
}

.brand-copy h1 {
  max-width: 460px;
  margin: 0;
  font-size: clamp(40px, 4.4vw, 59px);
  line-height: 1.04;
  letter-spacing: -0.048em;
}

.brand-copy > p:last-child {
  max-width: 390px;
  margin: 24px 0 0;
  color: #d8e3ff;
  font-size: 16px;
  line-height: 1.65;
}

.trust-note {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 17px 18px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.trust-note svg {
  flex: 0 0 28px;
  width: 28px;
  fill: none;
  stroke: #bcd0ff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.trust-note div {
  display: grid;
  gap: 3px;
}

.trust-note strong {
  font-size: 13px;
}

.trust-note span {
  color: #d2def9;
  font-size: 12px;
  line-height: 1.4;
}

.form-panel {
  display: grid;
  place-items: center;
  padding: clamp(38px, 6vw, 74px);
}

.state-view {
  width: min(100%, 430px);
}

.form-header {
  margin-bottom: 31px;
}

.form-header .eyebrow,
.connected-view .eyebrow {
  color: var(--blue);
}

.form-header h2,
.connected-view h2 {
  margin: 0;
  color: var(--ink);
  font-size: 34px;
  letter-spacing: -0.04em;
}

.form-header > p:last-child,
.connected-view > p:not(.eyebrow) {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.55;
}

.field + .field {
  margin-top: 20px;
}

.field label {
  display: block;
  margin-bottom: 9px;
  color: #263451;
  font-size: 13px;
  font-weight: 700;
}

.input-wrap {
  position: relative;
}

.input-wrap > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  width: 20px;
  transform: translateY(-50%);
  fill: none;
  stroke: #8190aa;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  pointer-events: none;
}

.input-wrap input {
  width: 100%;
  height: 54px;
  padding: 0 48px;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 13px;
  outline: 0;
  background: #fbfcff;
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.input-wrap input::placeholder {
  color: #a0a9ba;
}

.input-wrap input:hover {
  border-color: #bdc9db;
}

.input-wrap input:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(37, 88, 217, 0.11);
}

.field.has-error input {
  border-color: var(--danger);
  box-shadow: 0 0 0 4px rgba(180, 35, 63, 0.08);
}

.icon-button {
  position: absolute;
  top: 50%;
  right: 9px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  transform: translateY(-50%);
  border: 0;
  border-radius: 10px;
  color: #7d899f;
  background: transparent;
}

.icon-button:hover,
.icon-button:focus-visible {
  color: #33466c;
  background: #eef2f8;
  outline: 0;
}

.icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.field-error {
  min-height: 17px;
  margin: 5px 2px 0;
  color: var(--danger);
  font-size: 12px;
}

.primary-button,
.secondary-button {
  min-height: 54px;
  border-radius: 13px;
  font-weight: 750;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.primary-button {
  width: 100%;
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  border: 0;
  background: linear-gradient(135deg, #2a61e2, #1949c2);
  box-shadow: 0 12px 25px rgba(31, 78, 197, 0.24);
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #3169e9, #1743b3);
  box-shadow: 0 15px 28px rgba(31, 78, 197, 0.28);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(37, 88, 217, 0.24);
  outline-offset: 3px;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.button-arrow {
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.button-loading {
  align-items: center;
  gap: 9px;
}

.button-loading:not([hidden]) {
  display: flex;
}

.spinner {
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.spinner-dark {
  width: 26px;
  height: 26px;
  border-color: #d8e1f1;
  border-top-color: var(--blue);
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.form-footnote {
  margin: 24px 12px 0;
  color: #8a94a6;
  font-size: 12px;
  line-height: 1.55;
  text-align: center;
}

.alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 21px;
  padding: 12px 14px;
  color: #96203a;
  border: 1px solid #f1c7d0;
  border-radius: 12px;
  background: #fff4f6;
  font-size: 13px;
  line-height: 1.45;
}

.alert[hidden] {
  display: none;
}

.alert svg {
  flex: 0 0 19px;
  width: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.checking-view,
.connected-view {
  text-align: center;
}

.checking-view .spinner {
  margin: 0 auto 15px;
}

.checking-view p {
  color: var(--muted);
  font-size: 14px;
}

.success-mark {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  margin: 0 auto 28px;
  color: #16693e;
  border: 8px solid #dcf7e8;
  border-radius: 50%;
  background: #bcebd1;
}

.success-mark svg {
  width: 32px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.profile-loading {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 11px;
  margin: 25px 0 20px;
  color: var(--muted);
  font-size: 13px;
}

.profile-error {
  display: grid;
  gap: 9px;
  margin: 25px 0 20px;
  padding: 14px;
  color: #96203a;
  border: 1px solid #f1c7d0;
  border-radius: 12px;
  background: #fff4f6;
  font-size: 13px;
}

.profile-error button {
  justify-self: center;
  padding: 0;
  color: #8e1934;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-weight: 750;
}

.profile-card {
  margin: 27px 0 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7f9fd;
}

.profile-identity {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.profile-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  flex: 0 0 42px;
  place-items: center;
  color: #fff;
  border-radius: 12px;
  background: linear-gradient(135deg, #3972ed, #1948ba);
  font-size: 17px;
  font-weight: 800;
}

.profile-identity > div:last-child {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.profile-identity span,
.profile-item dt {
  color: var(--muted);
  font-size: 12px;
}

.profile-identity strong {
  overflow: hidden;
  color: var(--ink);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 0;
  padding: 4px 15px 12px;
  text-align: left;
}

.profile-item {
  min-width: 0;
  padding: 11px 6px 5px;
}

.profile-item-wide {
  grid-column: 1 / -1;
}

.profile-item dt {
  margin-bottom: 4px;
}

.profile-item dd {
  margin: 0;
  overflow-wrap: anywhere;
  color: #283753;
  font-size: 13px;
  font-weight: 700;
}

.secondary-button {
  width: 100%;
  color: #30415f;
  border: 1.5px solid var(--line);
  background: #fff;
}

.secondary-button:hover:not(:disabled) {
  border-color: #bdc9db;
  background: #f8faff;
}

.workspace-card {
  padding: clamp(26px, 4vw, 44px);
  border: 1px solid rgba(19, 47, 104, 0.08);
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 22px 55px rgba(30, 55, 105, 0.11);
}

.workspace-header,
.detail-heading,
.session-detail > header,
.unit-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.workspace-header h2,
.detail-heading h3,
.session-detail h4,
.unit-heading h4 {
  margin: 0;
  color: var(--ink);
  letter-spacing: -0.035em;
}

.workspace-header h2 {
  font-size: clamp(28px, 4vw, 40px);
}

.workspace-header p:last-child,
.detail-heading p:last-child {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.workspace-header .eyebrow,
.detail-heading .eyebrow,
.session-detail .eyebrow {
  margin-bottom: 8px;
  color: var(--blue);
}

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

.read-only-badge,
.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.read-only-badge {
  padding: 8px 12px;
  color: #28503d;
  border: 1px solid #c6ead8;
  background: #edfaf3;
}

.read-only-badge svg {
  width: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.document-studio {
  display: grid;
  gap: 26px;
}

.template-guide {
  padding: 20px;
  border: 1px solid #d6e1f3;
  border-radius: 18px;
  background: #f7f9fd;
}

.template-guide > strong {
  color: var(--ink);
  font-size: 15px;
}

.template-guide > p {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

.placeholder-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.placeholder-list code {
  padding: 7px 10px;
  color: #1744a5;
  border: 1px solid #cbd9f4;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  font-weight: 750;
}

.document-form {
  display: grid;
  gap: 22px;
}

.document-file,
.document-fields label {
  display: grid;
  gap: 8px;
  color: #2e3b56;
  font-size: 13px;
  font-weight: 750;
}

.document-file {
  padding: 18px;
  border: 1px dashed #aebfdb;
  border-radius: 16px;
  background: #fbfcff;
}

.document-file input {
  width: 100%;
  padding: 10px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.document-file input::file-selector-button {
  margin-right: 12px;
  padding: 8px 12px;
  color: #244370;
  border: 0;
  border-radius: 8px;
  background: #eaf0fb;
  font-weight: 750;
  cursor: pointer;
}

.document-file small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.document-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.document-fields input,
.document-fields select {
  width: 100%;
  padding: 12px 13px;
  color: var(--ink);
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  outline: none;
}

.document-fields input:focus,
.document-fields select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 88, 217, 0.1);
}

.document-actions {
  display: flex;
  align-items: center;
  gap: 18px;
}

.document-actions .primary-button {
  width: auto;
  min-width: 245px;
  padding-inline: 22px;
}

.document-upload-button {
  width: auto;
  min-width: 210px;
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 800;
}

.document-drive-link {
  justify-self: start;
  color: var(--blue);
  font-size: 14px;
  font-weight: 800;
}

.document-status {
  min-height: 20px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.document-status-success {
  color: #197044;
}

.document-status-error {
  color: var(--danger);
}

.compact-button,
.back-button,
.semester-button,
.session-button {
  border: 1px solid var(--line);
  color: #30415f;
  background: #fff;
  font-weight: 750;
}

.compact-button {
  padding: 9px 14px;
  border-radius: 10px;
}

.compact-button:hover,
.back-button:hover,
.semester-button:hover,
.session-button:hover {
  border-color: #9eb2d4;
  background: #f5f8fd;
}

.workspace-loading {
  min-height: 140px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.workspace-error {
  margin-top: 24px;
  padding: 16px;
  color: #96203a;
  border: 1px solid #f1c7d0;
  border-radius: 13px;
  background: #fff4f6;
  font-size: 13px;
}

.workspace-error button {
  margin-left: 8px;
  padding: 0;
  color: inherit;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  font-weight: 800;
}

.semester-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 32px 0 20px;
}

.semester-button {
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 12px;
}

.semester-button[aria-pressed="true"] {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

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

.course-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 17px;
  color: inherit;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfcff;
  text-align: left;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.course-card:hover {
  transform: translateY(-2px);
  border-color: #afc0df;
  box-shadow: 0 12px 28px rgba(35, 67, 128, 0.1);
}

.course-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(145deg, #3972ed, #1948ba);
  font-size: 14px;
  font-weight: 850;
}

.course-card-body {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.course-card-body strong {
  overflow: hidden;
  color: #22304c;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.course-semester,
.course-code,
.unit-heading span,
.progress-item > div span {
  color: var(--muted);
  font-size: 12px;
}

.course-semester {
  color: var(--blue);
  font-weight: 800;
}

.course-arrow {
  color: #7790be;
  font-size: 22px;
}

.course-detail {
  margin-top: 30px;
}

.detail-heading {
  justify-content: flex-start;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.detail-heading h3 {
  font-size: 25px;
}

.back-button {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: 12px;
  font-size: 20px;
}

.units-list {
  display: grid;
  gap: 13px;
  margin-top: 22px;
}

.unit-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: #fafcff;
}

.unit-heading h4 {
  font-size: 17px;
}

.session-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.session-button {
  padding: 8px 11px;
  border-radius: 9px;
  font-size: 12px;
}

.session-detail {
  margin-top: 22px;
  padding: 21px;
  border: 1px solid #cad8ef;
  border-radius: 17px;
  background: #f7faff;
}

.session-detail h4 {
  font-size: 21px;
}

.session-progress {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.progress-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.progress-item > div {
  display: grid;
  gap: 4px;
}

.progress-item > div strong {
  color: #283753;
  font-size: 14px;
}

.status-badge {
  padding: 7px 10px;
}

.status-verified {
  color: #17603d;
  background: #def6e9;
}

.status-pending {
  color: #815b08;
  background: #fff2c9;
}

.status-resubmit {
  color: #96203a;
  background: #ffe5eb;
}

.status-empty {
  color: #5d687d;
  background: #edf1f6;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 16px 0;
  padding: 30px;
  color: var(--muted);
  border: 1px dashed #c8d2e2;
  border-radius: 14px;
  text-align: center;
}

footer {
  display: flex;
  justify-content: center;
  gap: 10px;
  color: #7e8aa0;
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@media (max-width: 850px) {
  .page-shell {
    width: min(680px, calc(100% - 28px));
    padding-top: 24px;
  }

  .auth-card {
    grid-template-columns: 1fr;
  }

  .brand-panel {
    min-height: 330px;
    padding: 32px;
  }

  .brand-copy {
    padding: 48px 0 38px;
  }

  .brand-copy h1 {
    font-size: clamp(37px, 9vw, 51px);
  }

  .brand-copy > p:last-child {
    margin-top: 17px;
  }

  .form-panel {
    min-height: 540px;
    padding: 54px 32px;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  .page-shell {
    width: 100%;
    padding: 0;
    display: block;
    background: #fff;
  }

  .auth-card {
    min-height: 100vh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .brand-panel {
    min-height: 260px;
    padding: 25px 24px;
  }

  .brand-copy {
    padding: 37px 0 14px;
  }

  .brand-copy h1 {
    font-size: 37px;
  }

  .brand-copy > p:last-child {
    display: none;
  }

  .trust-note {
    display: none;
  }

  .form-panel {
    min-height: 560px;
    padding: 44px 24px 56px;
    align-items: start;
  }

  .form-header h2,
  .connected-view h2 {
    font-size: 30px;
  }

  footer {
    display: none;
  }

  .workspace-card {
    border-right: 0;
    border-left: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .workspace-header,
  .workspace-actions,
  .session-detail > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .workspace-actions {
    width: 100%;
  }

  .compact-button {
    width: 100%;
  }

  .document-fields {
    grid-template-columns: 1fr;
  }

  .document-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .document-actions .primary-button {
    width: 100%;
    min-width: 0;
  }

  .document-upload-button {
    width: 100%;
  }

  .progress-item {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
