:root {
  color-scheme: light;
  font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
  color: #192235;
  background: #f5f7fb;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  --muted: #68758b;
  --line: #dce3ed;
  --accent: #3659d9;
  --accent-dark: #2847bb;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    radial-gradient(ellipse at 50% -18%, #e4eaff 0, transparent 46rem),
    #f5f7fb;
}

input,
select,
textarea {
  direction: rtl;
  text-align: right;
}

select {
  direction: ltr;
  text-align: left;
}

.page-shell {
  width: min(100% - 32px, 720px);
  margin: 0 auto;
  padding: 48px 0 32px;
}

.site-header {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: var(--accent);
  font-size: 1.2rem;
  font-weight: 800;
  box-shadow: 0 8px 18px #3659d933;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: .73rem;
  font-weight: 750;
  letter-spacing: .11em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.3rem, 4vw, 1.7rem);
  letter-spacing: -.035em;
}

.intro {
  margin: 26px 0 20px;
  color: #536178;
  line-height: 1.65;
}

.intro p {
  margin: 0;
}

.card {
  padding: clamp(22px, 5vw, 34px);
  border: 1px solid #e5eaf2;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 14px 38px #253b5c0c;
}

.card-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 27px;
}

.card-heading h2,
.admin-card h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
  letter-spacing: -.02em;
}

.privacy-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  color: #28704e;
  background: #eaf7f0;
  font-size: .8rem;
  font-weight: 700;
}

.privacy-tag span {
  font-size: .6rem;
}

form {
  display: grid;
  gap: 11px;
}

label {
  margin-top: 7px;
  font-size: .88rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  color: #192235;
  background: #fff;
  font: inherit;
  transition: border-color .15s ease, box-shadow .15s ease;
}

textarea {
  min-height: 112px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: #7890ee;
  box-shadow: 0 0 0 3px #3659d91c;
}

input:disabled,
select:disabled,
textarea:disabled {
  cursor: not-allowed;
  color: #536178;
  background: #f3f5f9;
  opacity: 1;
}

input[readonly] {
  color: #536178;
  background: #f3f5f9;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.field-grid > div {
  display: grid;
  gap: 11px;
}

.autocomplete-wrap {
  position: relative;
}

.autocomplete-list {
  position: absolute;
  z-index: 2;
  inset-inline: 0;
  top: calc(100% + 5px);
  display: grid;
  max-height: 260px;
  overflow-y: auto;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px #253b5c1c;
}

.autocomplete-list[hidden] {
  display: none;
}

.autocomplete-option {
  padding: 11px 12px;
  border: 0;
  border-radius: 7px;
  color: #192235;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: right;
}

.autocomplete-option:hover,
.autocomplete-option:focus-visible {
  outline: none;
  background: #edf0ff;
}

.edit-details {
  margin: 9px 0 4px;
  padding: 14px 15px;
  border: 1px solid #e4e9f2;
  border-radius: 11px;
  background: #f9faff;
}

.edit-details summary,
.admin-section > summary {
  cursor: pointer;
  color: #35435c;
  font-size: .88rem;
  font-weight: 700;
}

.edit-details[open] summary {
  margin-bottom: 11px;
}

.field-hint {
  margin: 2px 0 5px;
  color: var(--muted);
  font-size: .82rem;
  line-height: 1.55;
}

.button {
  min-height: 46px;
  padding: 11px 18px;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  transition: background .15s ease, transform .15s ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button:disabled {
  cursor: wait;
  opacity: .7;
  transform: none;
}

.button-primary {
  margin-top: 9px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 6px 14px #3659d925;
}

.button-primary:hover {
  background: var(--accent-dark);
}

.button-secondary {
  color: #334fd0;
  background: #edf0ff;
}

.button-secondary:hover {
  background: #e1e7ff;
}

.message {
  margin-top: 17px;
  padding: 14px 15px;
  border-radius: 10px;
  color: #264c3a;
  background: #eaf7f0;
  font-size: .9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.message.error {
  color: #7e2930;
  background: #fff0f0;
}

.message code {
  display: inline-block;
  margin: 7px 0;
  padding: 8px 10px;
  border-radius: 7px;
  color: #253667;
  background: #e5ebff;
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .08em;
  user-select: all;
}

.admin-section {
  margin-top: 22px;
  padding: 15px 18px;
  border: 1px solid #e2e7f0;
  border-radius: 13px;
  background: #ffffffa6;
}

.admin-card {
  display: grid;
  gap: 18px;
  margin-top: 15px;
  padding: 22px;
}

.admin-login {
  grid-template-columns: 1fr auto;
  align-items: end;
  gap: 9px 12px;
}

.admin-login label {
  grid-column: 1 / -1;
}

#admin-tools {
  display: grid;
  gap: 13px;
}

#admin-tools[hidden],
#admin-login[hidden] {
  display: none;
}

#register-student-button[hidden] {
  display: none;
}

#admin-tools form {
  padding: 15px;
  border: 1px solid #e5eaf2;
  border-radius: 10px;
}

.admin-preview {
  display: grid;
  gap: 12px;
}

.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.preview-heading h3 {
  margin: 0 0 5px;
  font-size: 1.05rem;
}

.preview-heading .field-hint {
  margin: 0;
}

.table-scroll {
  max-height: min(65vh, 680px);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.table-scroll table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: .84rem;
  text-align: right;
}

.table-scroll th,
.table-scroll td {
  min-width: 90px;
  padding: 10px 12px;
  border-bottom: 1px solid #e7ebf1;
  vertical-align: top;
}

.table-scroll th {
  position: sticky;
  z-index: 1;
  top: 0;
  color: #fff;
  background: #3659d9;
  font-weight: 750;
  white-space: nowrap;
}

.table-scroll td:first-child,
.table-scroll td:nth-child(6),
.table-scroll td:last-child {
  min-width: 150px;
}

.table-scroll .preview-move {
  background: #fff5f5;
}

.table-scroll .preview-switch {
  background: #fff8dd;
}

.text-button {
  justify-self: start;
  padding: 7px 0;
  border: 0;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
}

footer {
  margin: 22px 5px 0;
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.6;
  text-align: center;
}

footer p {
  margin: 0;
}

@media (max-width: 560px) {
  .page-shell {
    padding-top: 28px;
  }

  .field-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .admin-login {
    grid-template-columns: 1fr;
  }

  .preview-heading {
    align-items: flex-start;
    flex-direction: column;
  }
}
