:root {
  --dtu-blue-900: #073b74;
  --dtu-blue-800: #0a4f96;
  --dtu-blue-700: #0d63b7;
  --dtu-blue-100: #e8f2fd;
  --dtu-gold: #f3c51b;
  --dtu-gold-dark: #d79b08;
  --ink: #102033;
  --muted: #65758b;
  --line: #d9e3ef;
  --surface: #ffffff;
  --surface-soft: #f5f8fc;
  --danger: #be123c;
  --success: #047857;
  --shadow: 0 18px 45px rgba(13, 51, 87, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background-color: #edf4fb;
  background-image:
    linear-gradient(180deg, rgba(5, 22, 42, 0.84) 0%, rgba(237, 244, 251, 0.94) 54%, rgba(237, 244, 251, 0.98) 100%),
    url('../assets/images/faculty-background.jpg'),
    url('../assets/images/campus-placeholder.svg');
  background-position: center top;
  background-size: cover;
  background-attachment: fixed;
  font-family: Inter, Arial, sans-serif;
  overflow-x: hidden;
}

body.rtl {
  direction: rtl;
  font-family: Cairo, Inter, Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.page-shell {
  width: min(1260px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.topbar,
.content-grid,
.hero-band,
.card {
  border: 1px solid rgba(217, 227, 239, 0.9);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 16px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(6, 30, 58, 0.96), rgba(7, 59, 116, 0.92));
  backdrop-filter: blur(16px);
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 45px rgba(5, 22, 42, 0.22);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.brand-logo {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 2px solid rgba(243, 197, 27, 0.72);
}

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

.brand strong {
  color: #fff;
  font-size: 1.18rem;
}

.brand small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.86rem;
}

.top-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}

.ghost-link,
.language-toggle,
.primary-button,
.secondary-button {
  min-width: 0;
  min-height: 44px;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 0 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.ghost-link,
.language-toggle,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--dtu-blue-800);
  background: #fff;
  border-color: var(--line);
}

.language-toggle {
  flex: 0 0 auto;
  gap: 7px;
  min-width: 58px;
  padding: 0 12px;
  text-transform: uppercase;
}

.language-toggle::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-radius: 50%;
  background:
    linear-gradient(currentColor, currentColor) center / 2px 100% no-repeat,
    linear-gradient(currentColor, currentColor) center / 100% 2px no-repeat;
  opacity: 0.9;
}

.topbar .ghost-link,
.topbar .language-toggle {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.26);
}

.topbar .ghost-link:hover,
.topbar .language-toggle:hover {
  background: rgba(243, 197, 27, 0.18);
  border-color: rgba(243, 197, 27, 0.58);
}

.primary-button {
  width: 100%;
  color: #fff;
  background: linear-gradient(135deg, var(--dtu-blue-900), var(--dtu-blue-700));
  box-shadow: 0 12px 24px rgba(13, 99, 183, 0.25);
}

.secondary-button {
  color: var(--dtu-blue-900);
}

.secondary-button.subtle {
  background: var(--surface-soft);
}

.ghost-link:hover,
.language-toggle:hover,
.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(13, 51, 87, 0.12);
}

.hero-band {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 430px);
  gap: 34px;
  align-items: center;
  min-height: 560px;
  padding: 46px;
  margin-bottom: 22px;
  overflow: hidden;
  border-radius: 8px;
  border-color: rgba(255, 255, 255, 0.18);
  background:
    linear-gradient(135deg, rgba(4, 19, 38, 0.64), rgba(7, 59, 116, 0.52) 58%, rgba(13, 99, 183, 0.44)),
    url('../assets/images/faculty-background.jpg') center / cover;
  box-shadow: 0 28px 70px rgba(5, 22, 42, 0.26);
}

.hero-band::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  z-index: 3;
  height: 7px;
  background: linear-gradient(90deg, var(--dtu-gold), var(--dtu-gold-dark), var(--dtu-blue-700));
  pointer-events: none;
}

body.rtl .hero-band::after {
  background: linear-gradient(270deg, var(--dtu-gold), var(--dtu-gold-dark), var(--dtu-blue-700));
}

.hero-visual {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  justify-self: end;
  width: min(100%, 430px);
  aspect-ratio: 911 / 1280;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  background: #061e3a;
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.28);
}

.hero-visual::before {
  content: '';
  position: absolute;
  inset: -20px;
  background:
    linear-gradient(180deg, rgba(7, 59, 116, 0.06), rgba(5, 22, 42, 0.16)),
    url('../assets/images/faculty-background.jpg') center / cover;
  filter: blur(12px);
  opacity: 0.74;
  transform: scale(1.06);
}

.hero-visual::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid rgba(243, 197, 27, 0.34);
  border-radius: 8px;
  pointer-events: none;
}

.hero-photo {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  filter: saturate(1.08) contrast(1.04);
}

.hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
  max-width: 650px;
}

.hero-copy .eyebrow {
  color: var(--dtu-gold);
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--dtu-blue-700);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.rtl .eyebrow {
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  color: var(--dtu-blue-900);
  font-size: 4.15rem;
  line-height: 1.02;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.hero-band h1 {
  color: #fff;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.26);
  overflow-wrap: break-word;
}

h2 {
  margin-bottom: 0;
  color: var(--ink);
  font-size: 1.48rem;
  overflow-wrap: anywhere;
}

.hero-copy p:last-child {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.04rem;
  line-height: 1.75;
  overflow-wrap: break-word;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, 0.84fr);
  gap: 22px;
  padding: 0;
  border: 0;
}

.content-grid > * {
  min-width: 0;
}

.card {
  min-width: 0;
  padding: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 4px solid var(--dtu-gold);
  box-shadow: 0 18px 48px rgba(13, 51, 87, 0.14);
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 24px;
  min-width: 0;
}

.section-heading > div {
  min-width: 0;
}

.section-heading.compact {
  margin-bottom: 16px;
}

.faculty-logo {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(13, 51, 87, 0.1);
}

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

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

label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 0.93rem;
  font-weight: 800;
}

label em {
  color: var(--muted);
  font-size: 0.76rem;
  font-style: normal;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfdff;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--dtu-blue-800) 50%),
    linear-gradient(135deg, var(--dtu-blue-800) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 21px,
    calc(100% - 12px) 21px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

body.rtl select {
  background-position: 18px 21px, 12px 21px;
}

input:focus,
select:focus {
  border-color: var(--dtu-blue-700);
  box-shadow: 0 0 0 4px rgba(13, 99, 183, 0.12);
}

.field-error {
  display: none;
  margin-top: 7px;
  color: var(--danger);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-group.has-error input,
.field-group.has-error select {
  border-color: var(--danger);
}

.field-group.has-error .field-error {
  display: block;
}

.form-message {
  display: none;
  margin: 4px 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  font-weight: 700;
}

.form-message.is-error {
  display: block;
  color: var(--danger);
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.form-message.is-success {
  display: block;
  color: var(--success);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

.qr-card {
  min-height: 460px;
}

.empty-state,
.qr-result {
  display: grid;
  justify-items: center;
  gap: 16px;
  text-align: center;
}

.empty-state {
  min-height: 318px;
  align-content: center;
  color: var(--muted);
}

.qr-placeholder {
  width: 210px;
  height: 210px;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13, 99, 183, 0.14) 12px, transparent 1%) center / 32px 32px,
    linear-gradient(rgba(243, 197, 27, 0.2) 12px, transparent 1%) center / 32px 32px,
    #fff;
  border: 1px dashed var(--line);
}

.qr-code {
  display: grid;
  place-items: center;
  width: 236px;
  min-height: 236px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.qr-code canvas,
.qr-code img {
  width: 204px;
  height: 204px;
}

.code-box {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}

.code-box span,
.code-box strong {
  display: block;
}

.code-box span {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
}

.code-box strong {
  color: var(--dtu-blue-900);
  overflow-wrap: anywhere;
}

.student-summary {
  width: 100%;
  display: grid;
  gap: 8px;
  color: var(--muted);
}

.student-summary strong {
  color: var(--ink);
}

.is-hidden {
  display: none !important;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(7, 25, 45, 0.48);
}

.modal-panel {
  position: relative;
  width: min(520px, 100%);
  padding: 28px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 28px 80px rgba(7, 25, 45, 0.22);
}

.modal-panel h2 {
  margin-bottom: 16px;
}

.modal-panel li {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.6;
}

.modal-close {
  position: absolute;
  inset-inline-end: 14px;
  top: 12px;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  color: var(--dtu-blue-900);
  background: var(--surface-soft);
  font-size: 1.4rem;
}

@media (max-width: 860px) {
  .topbar,
  .hero-band,
  .content-grid,
  .field-row {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
  }

  .hero-band {
    min-height: auto;
    padding: 30px;
  }

  .hero-visual {
    justify-self: center;
    width: min(100%, 430px);
  }

  h1 {
    font-size: 3.2rem;
  }

  .top-actions {
    width: 100%;
  }

  .ghost-link {
    flex: 1;
  }

  .language-toggle {
    flex: 0 0 auto;
  }
}

@media (max-width: 620px) {
  body {
    background-attachment: scroll;
  }

  .page-shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .topbar {
    flex-direction: column;
  }

  .top-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ghost-link {
    width: 100%;
  }

  .language-toggle {
    grid-column: 2;
    justify-self: end;
    width: auto;
  }

  .hero-band,
  .card {
    padding: 18px;
  }

  .hero-band {
    gap: 18px;
    margin-bottom: 16px;
  }

  .hero-visual {
    width: min(100%, 340px);
    max-height: none;
    aspect-ratio: 911 / 1280;
  }

  .hero-photo {
    object-fit: contain;
  }

  h1 {
    font-size: 1.95rem;
  }

  h2 {
    font-size: 1.28rem;
  }

  .brand-logo {
    width: 50px;
    height: 50px;
  }

  .button-row {
    width: 100%;
  }

  .secondary-button {
    width: 100%;
  }

  .faculty-logo {
    width: 54px;
    height: 54px;
  }
}
