.teacher-body { min-height: 100vh; overflow-x: hidden; background: linear-gradient(145deg, #fff1f2 0, #f8fafc 48%, #eef2ff 100%); }
.teacher-shell { width: min(900px, calc(100% - 28px)); margin: 0 auto; padding: 34px 0 64px; }
.teacher-intro { display: flex; align-items: center; gap: 18px; max-width: 760px; margin: 0 auto 22px; }
.teacher-intro > div, .teacher-panel, .form-heading > div { min-width: 0; }
.teacher-intro > img { width: 72px; height: 72px; padding: 5px; object-fit: contain; background: #fff; border-radius: 16px; box-shadow: var(--shadow); }
.teacher-intro h1 { margin: 3px 0 6px; color: var(--primary); font: 800 clamp(25px, 4.5vw, 38px)/1.1 Montserrat, sans-serif; }
.teacher-intro p:last-child { margin: 0; color: var(--muted); line-height: 1.5; }
.teacher-kicker { margin: 0; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.teacher-panel { padding: clamp(20px, 4vw, 34px); background: rgba(255,255,255,.96); border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 20px 60px rgba(15,23,42,.1); }
.form-heading { display: flex; justify-content: space-between; align-items: start; gap: 16px; margin-bottom: 22px; }
.form-heading h2 { margin: 0; font: 800 19px Montserrat, sans-serif; }
.form-heading p { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.privacy-badge { padding: 6px 10px; border: 1px solid #bbf7d0; border-radius: 999px; background: #f0fdf4; color: var(--ok); font-size: 11px; font-weight: 800; white-space: nowrap; }
.draft-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: -10px 0 18px; padding: 8px 9px 8px 11px; border: 1px solid #dbeafe; border-radius: 9px; background: #eff6ff; }
.draft-status { margin: 0; color: #1e40af; font-size: 11px; font-weight: 700; line-height: 1.4; }
.draft-bar button { flex: none; min-height: 32px; padding: 5px 9px; border: 1px solid #bfdbfe; border-radius: 7px; background: #fff; color: #1e40af; font: 800 10.5px Manrope, sans-serif; cursor: pointer; }
.draft-bar button:hover { border-color: #60a5fa; }
.required-mark, .teacher-field > span:not(.field-label), .field-label b, .photo-upload legend span { color: var(--bad); }
.form-sections { display: grid; gap: 18px; }
.form-section { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: #fbfcfe; }
.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; padding-bottom: 13px; border-bottom: 1px solid #e8edf3; }
.section-number { width: 32px; height: 32px; flex: none; display: grid; place-items: center; border-radius: 10px; background: var(--primary); color: #fff; font: 800 13px Montserrat, sans-serif; box-shadow: 0 4px 12px rgba(131,24,67,.2); }
.section-heading h3 { margin: 0; color: var(--ink); font: 800 15px Montserrat, sans-serif; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 11.5px; }
.teacher-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.teacher-field { min-width: 0; display: grid; align-content: start; gap: 7px; color: #475569; font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.field-label { color: #475569; font: inherit; }
.field-label b { margin-left: 2px; font: inherit; }
.teacher-field[hidden] { display: none; }
.teacher-field input, .teacher-field select, .teacher-field textarea { width: 100%; min-width: 0; max-width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); font: 600 14px Manrope, sans-serif; resize: vertical; }
.teacher-field textarea { min-height: 94px; }
.field-help { margin-top: -2px; color: var(--muted); font-size: 10.5px; font-weight: 600; }
.teacher-field input:focus, .teacher-field select:focus, .teacher-field textarea:focus { outline: 3px solid rgba(244,63,94,.16); border-color: var(--accent); }
.teacher-field input:disabled, .teacher-field select:disabled, .teacher-field textarea:disabled {
  border-color: #cbd5e1;
  background: #e2e8f0;
  color: #64748b;
  cursor: not-allowed;
  opacity: 1;
}
.teacher-field select:disabled { color: #64748b; }
.teacher-field input[readonly] { border-color: #cbd5e1; background: #f1f5f9; color: #475569; }
.field-help.lookup-ok { color: var(--ok); }
.field-help.lookup-error { color: var(--bad); }
.field-wide { grid-column: 1 / -1; }
.photo-upload { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #fff; }
.photo-upload legend { padding: 0 6px; color: #475569; font-size: 12px; font-weight: 800; }
.photo-row { display: flex; align-items: center; gap: 20px; }
.passport-preview { width: 110px; aspect-ratio: 35/45; flex: none; display: grid; place-items: center; overflow: hidden; border: 2px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; color: var(--muted); font-size: 12px; }
.passport-preview img { width: 100%; height: 100%; object-fit: cover; }
.photo-copy input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.photo-copy { min-width: 0; }
.photo-copy p { max-width: 520px; margin: 9px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: 11.5px; line-height: 1.5; }
.photo-copy .photo-message { color: var(--bad); font-weight: 700; }
.consent-row { display: flex; align-items: flex-start; gap: 10px; margin: 20px 0 0; color: #475569; font-size: 12px; line-height: 1.5; }
.consent-row input { flex: none; margin-top: 2px; }
.bot-field { position: absolute; left: -10000px; }
.teacher-message { min-height: 20px; margin: 15px 0 6px; color: var(--bad); font-size: 12.5px; font-weight: 700; }
.teacher-message.ok { color: var(--ok); }
.teacher-submit { min-width: 190px; justify-content: center; }
.submit-area { display: flex; flex-direction: column; align-items: flex-end; margin-top: 20px; }
.submit-area .teacher-message { width: 100%; text-align: right; }
.preview-dialog { width: min(760px, calc(100% - 28px)); max-height: min(88vh, 900px); padding: 0; overflow: auto; border: 0; border-radius: 20px; background: #fff; color: var(--ink); box-shadow: 0 28px 80px rgba(15,23,42,.32); }
.preview-dialog::backdrop { background: rgba(15,23,42,.62); backdrop-filter: blur(3px); }
.preview-header { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: flex-start; gap: 18px; padding: 22px 24px 16px; background: #fff; border-bottom: 1px solid var(--line); }
.preview-header h2 { margin: 4px 0 0; color: var(--primary); font: 800 20px/1.2 Montserrat, sans-serif; }
.preview-close { width: 34px; height: 34px; flex: none; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--muted); font-size: 23px; line-height: 1; cursor: pointer; }
.preview-close:hover { border-color: var(--primary); color: var(--primary); }
.preview-instruction { margin: 0; padding: 14px 24px; background: #fffbeb; color: #92400e; font-size: 12px; }
.preview-layout { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 20px; padding: 22px 24px 10px; align-items: start; }
.preview-photo { width: 120px; aspect-ratio: 35/45; object-fit: cover; border: 3px solid #fff; border-radius: 12px; background: #f1f5f9; box-shadow: 0 0 0 1px var(--line), 0 8px 20px rgba(15,23,42,.12); }
.preview-sections { display: grid; gap: 14px; }
.preview-group { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fbfcfe; }
.preview-group h3 { margin: 0 0 10px; color: var(--primary); font: 800 12px Montserrat, sans-serif; text-transform: uppercase; letter-spacing: .05em; }
.preview-group dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 18px; margin: 0; }
.preview-group dl > div { min-width: 0; }
.preview-group dt { color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; }
.preview-group dd { margin: 3px 0 0; overflow-wrap: anywhere; color: var(--ink); font-size: 12.5px; font-weight: 800; line-height: 1.4; white-space: pre-line; }
.preview-dialog > .teacher-message { margin: 6px 24px; }
.preview-actions { position: sticky; bottom: 0; z-index: 2; display: flex; justify-content: flex-end; gap: 10px; padding: 16px 24px 20px; background: #fff; border-top: 1px solid var(--line); }
@media (max-width: 650px) {
  .teacher-shell { width: calc(100% - 20px); padding: 20px 0 max(32px, env(safe-area-inset-bottom)); }
  .teacher-intro { align-items: center; gap: 12px; margin-bottom: 16px; }
  .teacher-intro > img { width: 54px; height: 54px; border-radius: 13px; }
  .teacher-intro h1 { font-size: clamp(22px, 7vw, 30px); }
  .teacher-intro p:last-child { font-size: 13px; }
  .teacher-panel { padding: 14px; border-radius: 16px; }
  .form-heading { display: block; margin-bottom: 16px; }
  .form-heading h2 { font-size: 17px; line-height: 1.35; overflow-wrap: anywhere; }
  .privacy-badge { display: inline-block; margin-top: 10px; white-space: normal; }
  .draft-bar { align-items: stretch; flex-direction: column; margin-top: -5px; }
  .draft-status { font-size: 11.5px; }
  .draft-bar button { min-height: 42px; }
  .form-sections { gap: 14px; }
  .form-section { padding: 14px; border-radius: 13px; }
  .section-heading { align-items: flex-start; margin-bottom: 15px; }
  .teacher-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .field-wide { grid-column: auto; }
  .teacher-field { font-size: 13px; }
  .teacher-field input, .teacher-field select, .teacher-field textarea { min-height: 48px; font-size: 16px; }
  .field-help { font-size: 11.5px; line-height: 1.4; }
  .photo-upload { padding: 14px; }
  .photo-row { align-items: flex-start; }
  .consent-row { font-size: 13px; }
  .consent-row input { width: 20px; height: 20px; }
  .teacher-submit { width: 100%; min-height: 48px; }
  .submit-area { align-items: stretch; }
  .submit-area .teacher-message { text-align: left; }
  .preview-dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 14px; }
  .preview-header { gap: 10px; padding: 16px 16px 13px; }
  .preview-header h2 { font-size: 18px; }
  .preview-close { width: 44px; height: 44px; }
  .preview-instruction { padding: 12px 16px; }
  .preview-layout { grid-template-columns: 1fr; gap: 14px; padding: 16px 16px 8px; }
  .preview-photo { width: 96px; justify-self: center; }
  .preview-group dl { grid-template-columns: 1fr; }
  .preview-dialog > .teacher-message { margin-inline: 16px; }
  .preview-actions { flex-direction: column-reverse; padding: 14px 16px max(16px, env(safe-area-inset-bottom)); }
  .preview-actions .btn { justify-content: center; width: 100%; min-height: 46px; }
}

.teacher-success-shell { width: min(560px, calc(100% - 28px)); min-height: 100dvh; margin: 0 auto; padding: 44px 0; display: grid; place-items: center; }
.teacher-success-card { width: 100%; padding: clamp(26px, 7vw, 44px); text-align: center; background: rgba(255,255,255,.97); border: 1px solid var(--line); border-radius: 24px; box-shadow: 0 24px 70px rgba(15,23,42,.14); }
.teacher-success-logo { width: 64px; height: 64px; margin-bottom: 20px; padding: 5px; object-fit: contain; background: #fff; border-radius: 15px; box-shadow: var(--shadow); }
.success-check { width: 72px; height: 72px; margin: 0 auto 20px; display: grid; place-items: center; border-radius: 50%; background: #dcfce7; color: var(--ok); font: 800 38px/1 Montserrat, sans-serif; }
.teacher-success-card h1 { margin: 7px 0 12px; color: var(--primary); font: 800 clamp(25px, 7vw, 34px)/1.15 Montserrat, sans-serif; }
.teacher-success-copy { margin: 0 auto; max-width: 420px; color: var(--muted); font-size: 14px; line-height: 1.65; }
.receipt-box { margin: 24px 0; padding: 16px; border: 1px solid #bbf7d0; border-radius: 14px; background: #f0fdf4; }
.receipt-box span { display: block; margin-bottom: 5px; color: #166534; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.receipt-box strong { color: #14532d; font: 800 22px Montserrat, sans-serif; letter-spacing: .04em; overflow-wrap: anywhere; }
.success-close-note { margin: 0; color: var(--ink); font-size: 14px; font-weight: 800; }
@media (max-width: 480px) {
  .teacher-success-shell { width: calc(100% - 20px); padding: 20px 0 max(20px, env(safe-area-inset-bottom)); }
  .teacher-success-card { border-radius: 18px; }
}

@media (max-width: 480px) {
  .photo-row { flex-direction: column; align-items: center; }
  .photo-copy, .photo-copy .btn { width: 100%; }
  .photo-copy .btn { justify-content: center; min-height: 46px; }
}

@media (max-width: 360px) {
  .teacher-shell { width: calc(100% - 12px); }
  .teacher-intro { gap: 9px; }
  .teacher-intro > img { width: 48px; height: 48px; }
  .teacher-intro h1 { font-size: 21px; }
  .teacher-kicker { font-size: 9px; letter-spacing: .1em; }
  .teacher-panel { padding: 10px; }
  .form-section { padding: 12px; }
  .section-heading { gap: 9px; }
  .section-number { width: 29px; height: 29px; }
}
