.login-page {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  min-height: calc(100dvh - var(--header-height) - var(--footer-height));
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.login-card {
  position: relative;
  width: min(100%, 430px);
  padding: 34px 30px 28px;
  overflow: hidden;
  border: 1px solid rgba(10, 92, 54, 0.08);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 10px 35px rgba(0, 0, 0, 0.1);
  animation: card-enter 0.42s ease-out both;
}

.login-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, #d4a843, #f5a623, #d4a843);
}

.login-card-head {
  display: grid;
  justify-items: center;
  margin-bottom: 24px;
  text-align: center;
}

.login-emblem {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  margin-bottom: 10px;
  color: var(--primary);
}

.login-emblem svg {
  width: 54px;
  height: 54px;
}

.login-card h1 {
  margin: 0;
  color: #293548;
  font-size: 1.75rem;
  font-weight: 800;
  line-height: 1.3;
}

.login-card-head > p {
  margin: 4px 0 12px;
  color: #7b8798;
  font-size: 0.88rem;
}

.status-banner {
  min-height: 31px;
  padding: 5px 12px;
  border: 1px solid #bde8cb;
  border-radius: 999px;
  color: #166534;
  background: #effbf3;
  font-size: 0.72rem;
  font-weight: 700;
}

.status-banner.closed {
  color: #9a3412;
  border-color: #fed7aa;
  background: #fff7ed;
}

.connection-time {
  margin-top: 7px;
  color: var(--text-muted);
  font-size: 0.63rem;
}

.connection-time strong {
  margin-inline-start: 5px;
  color: var(--primary);
}

.field-group {
  margin-bottom: 17px;
}

.field-group label,
.search-label {
  display: block;
  margin-bottom: 7px;
  color: #36483f;
  font-size: 0.8rem;
  font-weight: 700;
}

.input-shell,
.search-control {
  position: relative;
}

.input-shell > svg,
.search-control > svg {
  position: absolute;
  z-index: 1;
  top: 50%;
  right: 15px;
  width: 20px;
  height: 20px;
  color: var(--primary);
  transform: translateY(-50%);
  pointer-events: none;
}

.login-field,
.course-search {
  width: 100%;
  min-height: 50px;
  border: 2px solid #e2e8f0;
  border-radius: 10px;
  color: #293548;
  background: #f7fafc;
  font-size: 0.92rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.login-field {
  padding: 0 46px 0 14px;
}

.login-field::placeholder,
.course-search::placeholder {
  color: #98a4b3;
}

.login-field:focus,
.course-search:focus {
  border-color: var(--primary);
  outline: none;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(10, 92, 54, 0.12);
}

.honeypot-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.login-submit,
.primary-button,
.secondary-button,
.preview-button {
  min-height: 48px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.login-submit,
.primary-button {
  border: 0;
  color: #fff;
  background: var(--gradient-primary);
  box-shadow: 0 8px 20px rgba(10, 92, 54, 0.25);
}

.login-submit {
  width: 100%;
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 3px;
  font-size: 1rem;
}

.login-submit > svg,
.primary-button > svg,
.secondary-button > svg {
  width: 20px;
  height: 20px;
}

.login-submit:hover:not(:disabled),
.primary-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(10, 92, 54, 0.32);
}

.login-submit:disabled,
.primary-button:disabled {
  opacity: 0.58;
  box-shadow: none;
}

.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 16px;
  border: 1px solid #b9cec3;
  color: var(--primary-dark);
  background: #fff;
}

.secondary-button:hover:not(:disabled) {
  border-color: var(--primary);
  background: #f2faf5;
}

.compact-button {
  min-height: 38px;
  font-size: 0.76rem;
}

.preview-button {
  width: 100%;
  margin-top: 10px;
  border: 1px solid #dfbf63;
  color: #5e4810;
  background: #fff7d9;
}

.button-spinner,
.page-spinner {
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.button-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
}

.privacy-note {
  margin: 20px 0 0;
  padding-top: 16px;
  display: flex;
  align-items: flex-start;
  gap: 7px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.67rem;
  line-height: 1.75;
}

.privacy-note svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--gold);
}

.message,
.notice {
  border-radius: var(--radius-sm);
  line-height: 1.7;
}

.message {
  margin-bottom: 16px;
  padding: 11px 13px;
  border: 1px solid #feb2b2;
  border-right: 4px solid var(--danger);
  color: #9b2c2c;
  background: #fff5f5;
  font-size: 0.79rem;
}

.message.success {
  color: #166534;
  border-color: #bde8cb;
  border-right-color: var(--success);
  background: #f0fdf4;
}

.student-page,
.success-page {
  width: min(100% - 32px, var(--content-width));
  margin: 0 auto;
  padding: 32px 0 44px;
}

.student-identity-card {
  position: relative;
  padding: 27px 28px 25px;
  overflow: hidden;
  color: #fff;
  border-radius: 16px;
  background: var(--gradient-primary);
  box-shadow: 0 4px 20px rgba(10, 92, 54, 0.28);
}

.student-identity-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 34%;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 166, 35, 0.28), transparent 34%),
    linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.06));
  clip-path: polygon(22% 0, 100% 0, 72% 100%, 0 100%);
}

.student-title-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.section-kicker {
  color: var(--primary-light);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.student-identity-card .section-kicker {
  color: #ffe39e;
}

.student-title-row h2 {
  margin: 3px 0 2px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  font-weight: 800;
  line-height: 1.3;
}

.student-title-row p {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
}

.student-card-status {
  flex: 0 0 auto;
  min-width: 150px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.11);
}

.student-card-status span,
.student-card-status strong {
  display: block;
}

.student-card-status span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.62rem;
}

.student-card-status strong {
  color: #fff;
  font-size: 0.86rem;
}

.student-details-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: 20px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
}

.student-detail {
  min-width: 0;
  padding: 11px 13px;
  background: rgba(2, 57, 30, 0.28);
}

.student-detail span,
.student-detail strong {
  display: block;
}

.student-detail span {
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.6rem;
}

.student-detail strong {
  overflow: hidden;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.summary-card {
  position: relative;
  min-height: 105px;
  padding: 16px 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-right: 5px solid var(--primary);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.summary-card::after {
  content: "";
  position: absolute;
  left: -15px;
  bottom: -22px;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(10, 92, 54, 0.05);
}

.summary-card span,
.summary-card strong {
  display: block;
}

.summary-card span {
  color: var(--text-muted);
  font-size: 0.72rem;
}

.summary-card strong {
  margin-top: 5px;
  color: var(--primary);
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}

.summary-card strong.value-change {
  animation: value-pop 0.28s ease-out;
}

.content-card,
.save-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.content-card {
  margin-top: 18px;
  padding: 24px;
}

.progress-heading,
.section-heading,
.receipt-heading,
.save-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.progress-heading h3,
.section-heading h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: clamp(1.08rem, 2.3vw, 1.36rem);
  font-weight: 800;
}

.selection-counter {
  flex: 0 0 auto;
  color: var(--primary);
  font-size: 1.45rem;
  font-weight: 800;
}

.selection-counter.complete {
  color: var(--primary-dark);
}

.selection-progress {
  position: relative;
  height: 13px;
  margin-top: 18px;
  overflow: visible;
  border-radius: 999px;
  background: #e7efeb;
}

.selection-progress-bar {
  position: absolute;
  inset: 0 0 0 auto;
  width: 0;
  border-radius: inherit;
  background: var(--primary-light);
  transition: width 0.28s ease, background-color 0.28s ease;
}

.selection-progress.complete .selection-progress-bar {
  background: var(--primary-dark);
}

.selection-progress-bar i {
  position: absolute;
  top: 50%;
  left: -5px;
  width: 11px;
  height: 11px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--gold-bright);
  box-shadow: 0 1px 6px rgba(98, 68, 7, 0.3);
  transform: translateY(-50%);
}

.notice {
  padding: 12px 14px;
  display: flex;
  align-items: flex-start;
  gap: 9px;
  border: 1px solid;
  border-right-width: 4px;
  font-size: 0.78rem;
}

.notice svg {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin-top: 1px;
}

.notice.info {
  color: #0f6178;
  border-color: #b9e7f2;
  border-right-color: var(--info);
  background: #effbfe;
}

.notice.success {
  color: #166534;
  border-color: #bde8cb;
  border-right-color: var(--success);
  background: #f0fdf4;
}

.notice.warning {
  color: #8a5a12;
  border-color: #f4d99d;
  border-right-color: var(--warning);
  background: #fff9e9;
}

.notice.danger {
  color: #9b2c2c;
  border-color: #feb2b2;
  border-right-color: var(--danger);
  background: #fff5f5;
}

.selection-guidance {
  margin: 18px 0;
}

.search-wrap {
  margin: 20px 0 18px;
}

.search-control {
  width: min(100%, 520px);
}

.course-search {
  padding: 0 46px 0 46px;
}

.search-clear {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--text-muted);
  background: #e8efeb;
  transform: translateY(-50%);
  font-size: 1.15rem;
}

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

.course-card {
  position: relative;
  min-width: 0;
  min-height: 100px;
  padding: 18px 62px 16px 17px;
  overflow: hidden;
  border: 1px solid #cad8d1;
  border-radius: var(--radius-md);
  color: var(--text);
  background: #fff;
  text-align: right;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
}

.course-card::before {
  content: "";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 24px;
  height: 24px;
  border: 2px solid #a9bbb2;
  border-radius: 50%;
  background: #fff;
}

.course-card::after {
  content: "✓";
  position: absolute;
  top: 18px;
  right: 18px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--primary-light);
  opacity: 0;
  transform: scale(0.65);
  transition: opacity 0.18s ease, transform 0.18s ease;
  font-size: 0.8rem;
  font-weight: 800;
}

.course-card:hover:not(:disabled) {
  border-color: var(--primary-light);
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.course-card.selected {
  border: 2px solid var(--primary-light);
  background: #f0fbf4;
  box-shadow: 0 5px 18px rgba(10, 92, 54, 0.12);
}

.course-card.selected > .course-accent {
  opacity: 1;
}

.course-card.selected::before {
  border-color: var(--primary-light);
}

.course-card.selected::after {
  opacity: 1;
  transform: scale(1);
}

.course-card:disabled:not(.selected) {
  opacity: 0.54;
  cursor: not-allowed;
}

.course-accent {
  position: absolute;
  inset: 0 0 auto;
  height: 4px;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.course-name,
.course-origin,
.course-grade {
  display: block;
}

.course-name {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.55;
}

.course-origin,
.course-grade {
  margin-top: 5px;
  color: var(--text-muted);
  font-size: 0.67rem;
}

.empty-search {
  margin: 14px 0 0;
  padding: 22px;
  border: 1px dashed #b8c9c0;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  background: var(--surface-muted);
  text-align: center;
}

.badge {
  padding: 6px 12px;
  border: 1px solid #c8d8d0;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #eff7f2;
  font-size: 0.7rem;
  font-weight: 700;
}

.receipt-meta {
  margin: 17px 0 13px;
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.85;
}

.receipt-drop {
  min-height: 210px;
  margin-top: 17px;
  padding: 24px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 2px dashed #8fb9a2;
  border-radius: var(--radius-md);
  color: var(--primary-dark);
  background: #f6fbf8;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.receipt-drop:hover,
.receipt-drop.dragging {
  border-color: var(--primary-light);
  background: #edf9f1;
}

.receipt-drop.dragging {
  transform: scale(1.008);
}

.receipt-drop.disabled {
  opacity: 0.52;
  pointer-events: none;
}

.upload-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #8b6412;
  background: #fff1bd;
}

.upload-icon svg {
  width: 32px;
  height: 32px;
}

.receipt-drop strong {
  font-size: 1rem;
}

.receipt-drop small {
  color: var(--text-muted);
  font-size: 0.7rem;
}

.file-picker-label {
  margin-top: 5px;
  padding: 7px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 0.7rem;
  font-weight: 700;
}

.selected-file {
  margin-top: 14px;
  padding: 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 12px;
  border: 1px solid #bde8cb;
  border-radius: var(--radius-md);
  color: #166534;
  background: #f0fdf4;
}

.selected-file img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid rgba(10, 92, 54, 0.18);
}

.selected-file-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--danger);
  background: #fff;
  font-size: 0.68rem;
  font-weight: 800;
}

.selected-file strong,
.selected-file small {
  display: block;
  overflow-wrap: anywhere;
}

.selected-file small {
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 0.67rem;
}

#viewReceiptButton {
  margin-top: 12px;
}

.save-card {
  margin-top: 18px;
  padding: 20px 22px;
}

.save-card strong {
  color: var(--text);
  font-size: 0.88rem;
}

.save-card p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 0.7rem;
}

.save-button {
  flex: 0 0 auto;
  min-width: 230px;
  padding: 10px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
}

.success-page {
  min-height: calc(100vh - var(--header-height) - var(--footer-height));
  min-height: calc(100dvh - var(--header-height) - var(--footer-height));
  display: grid;
  place-items: center;
}

.success-card {
  width: min(100%, 700px);
  padding: 38px;
  border: 1px solid var(--border);
  border-top: 4px solid var(--gold);
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.success-mark {
  position: relative;
  width: 84px;
  height: 84px;
  margin: 0 auto 14px;
}

.success-mark::after {
  content: "";
  position: absolute;
  right: 2px;
  bottom: 4px;
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--gold-bright);
}

.success-mark svg {
  width: 84px;
  height: 84px;
}

.success-mark circle {
  fill: #eaf8ef;
  stroke: var(--success);
  stroke-width: 3px;
}

.success-mark path {
  fill: none;
  stroke: var(--success);
  stroke-width: 5px;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.success-card h2 {
  margin: 5px 0 8px;
  color: var(--primary-dark);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
}

.success-card > p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.8rem;
}

.success-courses {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
  text-align: right;
}

.success-course {
  padding: 10px 12px;
  border: 1px solid #cde5d7;
  border-radius: 9px;
  color: var(--primary-dark);
  background: #f3fbf6;
  font-size: 0.75rem;
  font-weight: 700;
}

.success-receipt {
  margin-bottom: 16px;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-muted);
  font-size: 0.75rem;
}

.success-receipt strong {
  color: var(--primary);
}

.success-card .notice {
  margin-bottom: 18px;
  text-align: right;
}

.success-card .primary-button {
  min-width: 210px;
  padding-inline: 22px;
}
