* {
  box-sizing: border-box;
}
:root {
  --bg: #f4f7fb;
  --card: #f1f7ff;
  --ink: #0d1b2a;
  --accent: #0a66a0;
  --accent-2: #0d8bd7;
  --stroke: #0a66a03a;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .06);
}

html, body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  color: var(--ink);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px;
}

/* Header (logo right) */
.page-header {
  margin: 8px 0 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
}
.page-header .moe {
  order: 1;
  height: 88px;
  object-fit: contain;
}
.page-header .divider {
  order: 2;
  width: 5px;
  height: 110px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 6px;
}
.page-header .brand {
  order: 3;
  display: block;
}
.brand-text {
  text-align: right;
}
.brand-line1 {
  font-size: 26px;
  font-weight: 700;
  line-height: 1.25;
}
.brand-line2 {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tab {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
.tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.title1 {
  margin-top: 30px;
  margin-bottom: 30px;
  text-align: center;
}

/* Form */
.card {
  background: var(--card);
  border: 2px solid var(--stroke);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.input {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  padding: 12px;
  border: 1.5px solid #b9d7ee;
  border-radius: 12px;
}
.input > span {
  font-weight: 600;
}
.input input,
.input textarea,
.input select {
  border: 1px solid #cfe5f7;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 16px;
  outline: none;
}
.input textarea {
  resize: vertical;
}
.input input:focus,
.input textarea:focus,
.input select:focus {
  border-color: var(--accent);
}
.input.textarea {
  grid-column: 1 / -1;
}
.message-box {
  margin-bottom: 20px;
}
.actions {
  display: flex;
  margin-top: 20px;   
  gap: 10px;
  justify-content: center;
}
.btn {
  display: inline-block;
  text-align: center;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}
.btn.primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn:disabled {
  opacity: .5;
  cursor: not-allowed;
}
.hint {
  opacity: .7;
  margin-top: 20px;
  display: block;
  text-align: center;
  font-weight: 600;
}
.hint-inline {
  opacity: .7;
  display: block;
  margin-top: 6px;
  font-size: 12px;
}
.hp {
  display: none !important;
}
.status {
  border: 1px dashed var(--accent);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}
.status.ok {
  border-color: #16a34a;
}
.status.err {
  border-color: #b91c1c;
}
.footer {
  display: flex;
  justify-content: center;
  opacity: .7;
}

/* Panels */
.panel {
  display: none;
  margin-top: 6px;
}
.panel.active {
  display: block;
}
.panel-title {
  font-weight: 800;
  margin-bottom: 6px;
}
.radio-group {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.radio {
  display: flex;
  align-items: center;
  gap: 6px;
}
.teacher-only {
  display: none;
}

/* datetime row */
.dt-row {
  display: flex;
  gap: 8px;
}
.dt-row input {
  flex: 1;
}

/* Capture card */
.capture-card {
  position: absolute;
  left: -99999px;
  top: 0;
  width: 1000px;
  background: #fff;
  color: var(--ink);
  border: 2px solid var(--stroke);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 30px rgba(0,0,0,.06);
  font-family: 'IBM Plex Sans Arabic', system-ui, sans-serif;
  direction: rtl;
}
.cap-header, .cap-footer {
  text-align: center;
  margin-bottom: 12px;
}
.cap-title {
  font-weight: 800;
  font-size: 28px;
  letter-spacing: .3px;
}
.cap-meta {
  font-size: 14px;
  opacity: .8;
  margin-top: 6px;
}
.cap-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.cap-box {
  background: #fdfefe;
  border: 1.5px solid #b9d7ee;
  border-radius: 12px;
  padding: 12px 14px;
}
.cap-label {
  font-size: 14px;
  opacity: .8;
  margin-bottom: 6px;
  font-weight: 600;
}
.cap-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.4;
  word-wrap: break-word;
  white-space: pre-wrap;
}
.cap-subject {
  grid-column: 1 / -1;
}
.cap-multiline {
  min-height: 140px;
}

@media (max-width:720px){
  /* One-column grid for small screens */
  .grid {
    grid-template-columns: 1fr;
  }

  /* Header: clean vertical stacking */
  .page-header {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 12px auto 18px;
    text-align: center;
  }

  .page-header .moe {
    height: 60px;
    object-fit: contain;
  }

  /* Short divider (horizontal, subtle) */
  .page-header .divider {
    width: 70px;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border-radius: 3px;
    margin: 4px 0;
  }

  .brand-text {
    text-align: center;
    line-height: 1.4;
  }

  .brand-line1 {
    font-size: 20px;
    font-weight: 700;
  }

  .brand-line2 {
    font-size: 17px;
    font-weight: 600;
  }

  /* Tabs: smaller, neat, fit screen */
  .tabs {
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
  }
  .tab {
    flex: 1 1 45%;
    text-align: center;
    padding: 8px 10px;
    font-size: 14px;
    border-radius: 999px;
  }
}
