:root{
  --bg: #f7f4ef;
  --panel: #ffffff;
  --panel-soft: #f1ebe2;
  --text: #201a16;
  --muted: #6f645a;
  --line: #ddd2c6;
  --primary: #7a4f2a;
  --primary-dark: #603d21;
  --danger: #b42318;
  --radius: 22px;
  --shadow: 0 18px 45px rgba(29, 21, 14, 0.10);
  --container: 980px;
}

*{
  box-sizing: border-box;
}

html{
  scroll-behavior: smooth;
}

body{
  margin: 0;
  background: linear-gradient(180deg, #f8f5ef 0%, #efe8de 100%);
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Arial, sans-serif;
  line-height: 1.6;
}

a{
  color: inherit;
  text-decoration: none;
}

.container{
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.topbar{
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255,255,255,0.84);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(0,0,0,.05);
}

.topbar-inner{
  min-height: 74px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.back-link{
  font-weight: 600;
  color: var(--primary);
}

.school-name{
  color: var(--muted);
  text-align: right;
  font-size: .95rem;
}

.page{
  padding: 38px 0 72px;
}

.hero{
  margin-bottom: 24px;
}

.eyebrow{
  margin: 0 0 8px;
  text-transform: uppercase;
  letter-spacing: .14em;
  color: var(--primary);
  font-weight: 700;
  font-size: .78rem;
}

.hero h1{
  margin: 0 0 14px;
  line-height: 1.12;
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.lead{
  margin: 0;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.05rem;
}

.form-card{
  background: rgba(255,255,255,.94);
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 30px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.form-section{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  margin-bottom: 18px;
}

.form-section h2{
  margin-top: 0;
  margin-bottom: 8px;
  font-size: 1.5rem;
}

.note{
  margin-top: 0;
  margin-bottom: 20px;
  color: var(--muted);
  font-size: .98rem;
}

.grid{
  display: grid;
  gap: 18px;
}

.grid-1{
  grid-template-columns: 1fr;
}

.grid-2{
  grid-template-columns: repeat(2, 1fr);
}

.grid-3{
  grid-template-columns: repeat(3, 1fr);
}

.field{
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field.full{
  grid-column: 1 / -1;
}

label{
  font-weight: 600;
}

input,
select,
textarea{
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
  color: var(--text);
  padding: 14px 16px;
  font: inherit;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

input:focus,
select:focus,
textarea:focus{
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(122,79,42,.10);
}

textarea{
  resize: vertical;
  min-height: 110px;
}

.checkbox{
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
}

.checkbox input{
  width: 18px;
  height: 18px;
  margin-top: 3px;
  padding: 0;
  flex: 0 0 auto;
}

.form-actions{
  padding: 12px 4px 6px;
  text-align: center;
}

.submit-btn{
  border: 0;
  background: var(--primary);
  color: #fff;
  min-height: 56px;
  padding: 0 30px;
  border-radius: 999px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: background .2s ease, transform .2s ease;
}

.submit-btn:hover{
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.form-info{
  margin: 14px 0 0;
  color: var(--muted);
  font-size: .94rem;
}

.error-message{
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 600;
}

.success-box,
.error-box{
  max-width: 840px;
  margin: 48px auto;
  background: rgba(255,255,255,.95);
  border-radius: 28px;
  padding: 32px;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.success-box h1,
.error-box h1{
  margin-top: 0;
}

.success-box p,
.error-box p{
  color: var(--muted);
}

.result-actions{
  margin-top: 24px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 600;
}

.btn-primary{
  background: var(--primary);
  color: #fff;
}

.btn-secondary{
  background: #fff;
  color: var(--text);
  border: 1px solid var(--line);
}

.form-note{
  margin: 18px 0 24px;
  padding: 16px 18px;
  background: #f8f6f2;
  border-left: 4px solid var(--primary);
  border-radius: 10px;
  font-size: .95rem;
  color: var(--text);
}

.form-note a{
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
}

.form-note a:hover{
  opacity: .8;
}

.pdf-link{
  position: relative;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-left: 22px;
}

.pdf-link::before{
  content: "📄";
  position: absolute;
  left: 0;
  top: -1px;
  font-size: 0.95rem;
}
.pdf-link::after{
  content: " (PDF)";
  font-weight: 400;
  font-size: .9em;
  color: var(--muted);
}
.pdf-link:hover{
  opacity: .8;
}

@media (max-width: 900px){
  .grid-2,
  .grid-3{
    grid-template-columns: 1fr;
  }

  .topbar-inner{
    flex-direction: column;
    align-items: flex-start;
    padding: 14px 0;
  }

  .school-name{
    text-align: left;
  }
}

@media (max-width: 560px){
  .container{
    width: min(var(--container), calc(100% - 22px));
  }

  .form-card{
    padding: 12px;
    border-radius: 22px;
  }

  .form-section{
    padding: 20px;
    border-radius: 20px;
  }

  .submit-btn{
    width: 100%;
  }

  .result-actions{
    flex-direction: column;
  }

  .btn{
    width: 100%;
  }
}