:root{
  --bg0:#f5f6f8;
  --bg1:#eef1f6;
  --card:#ffffff;
  --text:#0b1220;
  --muted:rgba(11,18,32,.62);
  --line:rgba(11,18,32,.10);
  --shadow: 0 18px 50px rgba(11,18,32,.10);
  --radius: 18px;
  --radius2: 14px;

  --accent:#1e66ff;           /* elegant blue */
  --accentSoft:rgba(30,102,255,.14);
  --danger:#d64545;
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  color:var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1200px 600px at 10% -10%, #ffffff 0%, transparent 60%),
    radial-gradient(900px 500px at 90% 0%, #ffffff 0%, transparent 55%),
    linear-gradient(180deg, var(--bg1), var(--bg0));
}

.page{
  max-width: 980px;
  margin: 0 auto;
  padding: 26px 14px 60px;
}

.header{
  display:flex;
  justify-content:center;
  padding: 10px 0 18px;
}

.brand{
  display:flex;
  align-items:center;
  gap: 14px;
  flex-wrap: wrap;
  justify-content:center;
  text-align:center;
}

.logo{
  max-height: 58px;
  max-width: 240px;       /* prevents logo from swallowing title */
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(0,0,0,.08));
}

.brandText{ line-height:1.1; }
.logoText{
  font-weight: 800;
  font-size: 26px;
  letter-spacing: -0.02em;
}
.subText{
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 520px){
  .brand{ flex-direction: column; gap: 10px; }
  .logo{ max-width: 260px; }
  .logoText{ font-size: 24px; }
}

.card{
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.section{
  margin: 26px 0 10px;
  font-size: 18px;
  letter-spacing:-0.01em;
}
.subsection{
  margin: 18px 0 10px;
  font-size: 16px;
}

.field{ margin: 14px 0; }

label, .label{
  display:block;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.req{
  margin-left: 6px;
  font-weight: 900;
  color: var(--danger);
  transition: color .15s ease;
}
.field.valid .req{
  color: var(--accent);
  text-shadow: 0 0 14px rgba(30,102,255,.22);
}

input,select,textarea{
  width:100%;
  border: 1px solid rgba(11,18,32,.12);
  border-radius: var(--radius2);
  padding: 12px 14px;
  font-size: 15px;
  background: #fff;
  color: var(--text);
  outline: none;
  transition: box-shadow .15s ease, border-color .15s ease;
}

textarea{ resize: vertical; }
input:focus,select:focus,textarea:focus{
  border-color: rgba(30,102,255,.55);
  box-shadow: 0 0 0 5px var(--accentSoft);
}

.hint{
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.grid2{
  display:grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 780px){
  .grid2{ grid-template-columns: 1fr 1fr; }
}

.radioRow{
  display:flex;
  gap: 18px;
  flex-wrap: wrap;
  padding: 4px 0;
}
.radioCol{
  display:grid;
  gap: 10px;
  padding: 4px 0;
}
.radioRow label, .radioCol label{
  font-weight: 600;
}
.radioRow input, .radioCol input{
  width:auto;
  margin-right: 9px;
}

.info{
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px 14px;
  background: linear-gradient(180deg, #fbfbfd, #f7f9ff);
  margin-top: 12px;
}
.info p{ margin: 10px 0; }

.signature{
  width:100%;
  height: 175px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background:#fff;
  touch-action:none;
}

.sigActions{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.muted{ color: var(--muted); }

.actions{
  display:flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

.btn{
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 11px 16px;
  border-radius: 14px;
  font-weight: 800;
  cursor: pointer;
  text-decoration: none;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition: transform .06s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active{ transform: translateY(1px); }
.btn.primary{
  border-color: rgba(0,0,0,.0);
  color:#fff;
  background: linear-gradient(180deg, #0b1220, #111a2d);
  box-shadow: 0 14px 30px rgba(11,18,32,.18);
}
.btn.secondary{ background: rgba(11,18,32,.05); }
.btn.ghost{ background: transparent; }

.btn:disabled{ opacity:.6; cursor:not-allowed; }

.error{
  min-height: 16px;
  margin-top: 8px;
  color: var(--danger);
  font-size: 12px;
}
.formMessage{ margin-top: 10px; color: var(--muted); }

.thankYou{
  margin-top: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
}

.dialog::backdrop{ background: rgba(0,0,0,.48); }
.dialog{
  border:none;
  border-radius: 18px;
  padding:0;
  width: min(820px, calc(100% - 24px));
  box-shadow: var(--shadow);
}
.dialogBody{ padding: 18px; }
.dialogScroll{
  max-height: min(64vh, 560px);
  overflow:auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background:#fff;
}
.dialogActions{
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  margin-top: 12px;
}

.hp{ position:absolute; left:-9999px; top:-9999px; height:1px; width:1px; overflow:hidden; }

.listWrap{ display:grid; gap: 10px; }
.listRow{ display:flex; gap: 10px; align-items:center; }
.listRow input{ flex:1; }
