
:root{
  --bg:#f4f8fd;
  --surface:#ffffff;
  --surface-2:#f8fbff;
  --text:#0f172a;
  --muted:#64748b;
  --line:#dbe5f0;
  --primary:#2563eb;
  --primary-2:#3b82f6;
  --danger:#dc2626;
  --success:#2563eb;
  --shadow:0 18px 48px rgba(15,23,42,.08);
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:14px;
  --container:920px;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
html.modal-open,
body.modal-open{overflow:hidden;}
body{
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Noto Sans JP","Hiragino Sans",sans-serif;
  color:var(--text);
  background:
    radial-gradient(circle at top left, rgba(96,165,250,.15), transparent 28%),
    linear-gradient(180deg,#f8fbff 0%,#eef4fb 100%);
  line-height:1.6;
}
img{display:block;max-width:100%}
button,input,select,textarea{font:inherit}
a{color:inherit}

.container{
  width:min(calc(100% - 28px), var(--container));
  margin:0 auto;
}
.narrow{width:min(calc(100% - 28px), 880px)}

.site-header{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(12px);
  background:#338bffeb;
  border-bottom:1px solid rgba(96,165,250,.22);
}
.header-inner{
  min-height:62px;
  display:flex;
  align-items:center;
}
.brand{
  display:inline-flex;
  align-items:center;
  width:100%;
  max-width:240px;
}
.brand img{
  width:100%;
  height:auto;
}

.site-main{
  padding:24px 0 36px;
}

.form-card{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(148,163,184,.18);
  border-radius:var(--radius-xl);
  box-shadow:var(--shadow);
  padding:24px;
}
.form-head{
  margin-bottom:18px;
}
.form-head.minimal{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:16px;
}
.form-title, .form-head h1{
  margin:0;
  font-size:clamp(24px,3.6vw,34px);
  line-height:1.15;
  letter-spacing:-.03em;
}
.form-subtitle{
  margin:0;
  color:var(--muted);
  font-size:13px;
}
.required{
  color:var(--danger);
  font-size:12px;
  margin-left:4px;
}

.form-message{
  margin-bottom:14px;
  padding:12px 14px;
  border-radius:12px;
  background:#eff6ff;
  font-size:14px;
}

.field-group{margin-top:16px}
.field-grid{
  display:grid;
  gap:14px;
  margin-top:16px;
}
.cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}
.cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}

.field{min-width:0}
.field label{
  display:block;
  margin-bottom:8px;
  font-size:13px;
  font-weight:800;
  color:#1e293b;
}
.field input,
.field select,
.field textarea,
.search-input,
.picker-trigger{
  width:100%;
  min-height:50px;
  border-radius:16px;
  border:1px solid rgba(148,163,184,.28);
  background:#fff;
  padding:0 14px;
  color:var(--text);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.7);
}
.field textarea{
  min-height:120px;
  padding:14px;
  resize:vertical;
}
.field input:focus,
.field select:focus,
.field textarea:focus,
.search-input:focus,
.picker-trigger:focus{
  outline:none;
  border-color:rgba(37,99,235,.55);
  box-shadow:0 0 0 4px rgba(37,99,235,.12);
}
.field select[multiple]{
  min-height:140px;
  padding:10px 12px;
}
.help-text,
.loading-text,
.counter{
  margin:6px 0 0;
  font-size:12px;
  color:var(--muted);
}
.loading-text{min-height:18px}
.field-footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
}
.error{
  min-height:18px;
  margin:6px 0 0;
  font-size:12px;
  color:var(--danger);
}

.search-select{
  position:relative;
}
.search-input{
  padding-right:46px;
}
.search-toggle{
  position:absolute;
  top:50%;
  right:10px;
  transform:translateY(-50%);
  width:28px;
  height:28px;
  border:none;
  background:transparent;
  color:#475569;
  cursor:pointer;
  font-size:18px;
}
.search-toggle:disabled{opacity:.45;cursor:not-allowed}
.search-dropdown{
  position:absolute;
  left:0; right:0;
  top:calc(100% + 8px);
  background:#fff;
  border:1px solid rgba(148,163,184,.2);
  border-radius:16px;
  box-shadow:0 24px 42px rgba(15,23,42,.14);
  max-height:280px;
  overflow:auto;
  z-index:15;
}
.search-dropdown-list{padding:8px}
.search-option{
  width:100%;
  border:none;
  background:#fff;
  text-align:left;
  padding:10px 12px;
  border-radius:12px;
  cursor:pointer;
}
.search-option:hover{background:#eff6ff}
.search-option.is-empty,
.search-empty{
  padding:12px;
  color:var(--muted);
  font-size:13px;
}

.picker-trigger{
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:2px;
  text-align:left;
  padding:10px 14px;
}
.picker-trigger:disabled{
  opacity:.6;
  cursor:not-allowed;
  background:#f8fafc;
}
.picker-summary{
  display:block;
  width:100%;
  font-size:14px;
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.picker-meta{
  font-size:12px;
  color:var(--muted);
}

.agreement-box{
  margin-top:22px;
  text-align:center;
}
.agreement-check{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  font-size:14px;
}
.agreement-check input{
  margin:0;
}
.agreement-check a{
  color:var(--primary);
  text-decoration:none;
}
.agreement-check a:hover{text-decoration:underline}

.submit-area{
  margin-top:18px;
}
.submit-button{
  width:100%;
  min-height:54px;
  border:none;
  border-radius:999px;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
  color:#fff;
  font-weight:900;
  font-size:15px;
  cursor:pointer;
  box-shadow:0 16px 30px rgba(37,99,235,.24);
}
.submit-button:disabled{
  cursor:not-allowed;
  opacity:.45;
  box-shadow:none;
}
.submit-status{
  min-height:22px;
  margin:10px 0 0;
  font-size:13px;
  color:var(--muted);
}
.submit-status.is-error{color:var(--danger)}
.submit-status.is-success{color:var(--success)}

.site-footer{
  padding:12px 0 18px;
}
.footer-inner{
  display:flex;
  justify-content:center;
}
.footer-nav{
  display:flex;
  gap:18px;
  flex-wrap:wrap;
  justify-content:center;
}
.footer-nav a{
  color:#475569;
  text-decoration:none;
  font-size:13px;
}
.footer-nav a:hover{text-decoration:underline}

.modal[hidden]{display:none}
.modal{
  position:fixed;
  inset:0;
  z-index:50;
}
.modal-backdrop{
  position:absolute;
  inset:0;
  background:rgba(15,23,42,.45);
}
.modal-dialog{
  position:relative;
  z-index:1;
  width:min(calc(100% - 24px), 720px);
  max-height:min(82vh, 760px);
  margin:6vh auto 0;
  background:#fff;
  border-radius:24px;
  box-shadow:0 24px 54px rgba(15,23,42,.24);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.modal-header,
.modal-footer{
  padding:16px 18px;
  border-bottom:1px solid rgba(148,163,184,.18);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
}
.modal-footer{
  border-top:1px solid rgba(148,163,184,.18);
  border-bottom:none;
}
.modal-body{
  padding:14px 18px;
  overflow:auto;
}
.modal-close{
  width:36px;height:36px;
  border:none;border-radius:999px;
  background:#f1f5f9;
  cursor:pointer;
  font-size:22px;line-height:1;
}
.modal-options{
  display:grid;
  gap:14px;
}
.option-group{
  border:1px solid rgba(148,163,184,.18);
  border-radius:18px;
  padding:12px;
  background:#fbfdff;
}
.option-group-title{
  margin:0 0 10px;
  font-size:14px;
  font-weight:800;
  color:#334155;
}
.option-list{
  display:grid;
  gap:8px;
}
.option-check{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:8px 10px;
  border-radius:12px;
  background:#fff;
  border:1px solid rgba(148,163,184,.14);
}
.option-check input{margin-top:3px}
.option-check span{
  font-size:14px;
  line-height:1.5;
}
.modal-primary,
.modal-secondary{
  min-height:44px;
  padding:0 16px;
  border-radius:999px;
  border:none;
  cursor:pointer;
  font-weight:800;
}
.modal-primary{
  color:#fff;
  background:linear-gradient(135deg,var(--primary),var(--primary-2));
}
.modal-secondary{
  color:#334155;
  background:#eef2f7;
}

@media (max-width: 860px){
  .cols-3{grid-template-columns:1fr}
}
@media (max-width: 720px){
  .header-inner{min-height:54px}
  .site-main{padding-top:18px}
  .form-card{padding:18px}
  .form-head.minimal{align-items:flex-start;flex-direction:column}
  .cols-2{grid-template-columns:1fr}
  .footer-nav{
    flex-direction:column;
    align-items:center;
    gap:8px;
  }
  .modal-dialog{
    width:calc(100% - 16px);
    margin-top:4vh;
    max-height:88vh;
  }
}