@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@500;600;700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --cb-dark: #0d2d4a;
  --cb-main: #8dbb4d;
  --cb-mid: #6b9a2f;
  --cb-pale: #e8f3d9;
  --cb-mist: #f3f8ec;
  --stone: #c8b46a;
  --stone-mid: #a89446;
  --stone-light: #f8f4e3;
  --stone-deep: #5a4a10;
  --text-primary: #0d1e2d;
  --text-muted: #5a7a8a;
  --border: rgba(0, 130, 160, 0.15);
  --radius: 10px;
  --danger: #cc4b37;
  --ok: #2f8f6e;
  --white: #fff;
}

body.event-uv {
  --cb-main: #c44b2a;
  --cb-mid: #a83520;
  --cb-pale: #faece7;
  --cb-mist: #faece7;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  min-height: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--text-primary);
  background: #f1f6f6;
  font-family: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

a {
  color: var(--cb-mid);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.top-line {
  height: 3px;
  flex-shrink: 0;
  background: var(--cb-main);
}

.site-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
  padding: 0 24px;
  border-bottom: 1px solid #e0e8ec;
  background: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.wordmark {
  display: inline-flex;
  flex-direction: column;
  line-height: 1.15;
}

.wordmark .en {
  color: #5a7a8a;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.wordmark .jp {
  color: #0d2d4a;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 13px;
  border: 1px solid var(--cb-main);
  border-radius: 999px;
  color: var(--cb-mid);
  background: var(--cb-mist);
  font-size: 12px;
  font-weight: 700;
}

.site-main {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 40px 16px 56px;
}

.site-main.center {
  align-items: center;
}

.site-footer {
  flex-shrink: 0;
  padding: 22px 24px 18px;
  background: var(--cb-dark);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.site-footer .inner {
  max-width: 760px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 auto;
}

.site-footer .links {
  display: flex;
  flex-wrap: wrap;
  list-style: none;
}

.site-footer .links a {
  display: inline-block;
  padding: 0 11px;
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.site-footer .links li:last-child a {
  border-right: 0;
}

.form-container,
.flow-card {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: 0 2px 16px rgba(13, 45, 74, 0.05);
}

.flow-card {
  max-width: 680px;
  padding: 36px 40px;
}

.form-header {
  padding: 28px 28px 20px;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.form-header.center {
  text-align: center;
}

.form-header h1,
.form-header h2 {
  margin: 0 0 8px;
  color: var(--cb-dark);
  font-family: 'Noto Serif JP', serif;
  font-size: 21px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.form-header p {
  margin: 0;
  color: var(--text-muted);
  font-size: 13px;
}

.form-content {
  padding: 28px;
}

.step-indicator {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 12px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.step-num {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cb-mid);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.step span {
  color: var(--cb-dark);
  font-weight: 500;
}

.step.inactive .step-num {
  background: #d2e0e0;
  color: #8aa1a1;
}

.step.inactive span {
  color: var(--text-muted);
  font-weight: 400;
}

.form-section {
  margin-bottom: 32px;
}

.form-section-title,
.section-label,
.conf-section-label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding-bottom: 11px;
  border-bottom: 1px solid var(--border);
  color: var(--cb-dark);
  font-size: 14px;
  font-weight: 700;
}

.section-label,
.conf-section-label {
  margin-top: 24px;
  margin-bottom: 12px;
  border-bottom: 2px solid var(--cb-mist);
  color: var(--cb-mid);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.form-section-title::before,
.section-label::before,
.conf-section-label::before {
  content: "";
  width: 4px;
  height: 14px;
  display: inline-block;
  border-radius: 2px;
  background: var(--cb-main);
}

.form-field {
  margin-bottom: 20px;
}

.form-field label,
.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.required {
  color: var(--danger);
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  background: #fcfefe;
  font: inherit;
  font-size: 14px;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

input::placeholder,
textarea::placeholder {
  color: #aebcc2;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--cb-main);
  background: var(--cb-mist);
  box-shadow: 0 0 0 3px rgba(58, 148, 32, 0.12);
}

body.event-uv input:focus,
body.event-uv select:focus,
body.event-uv textarea:focus {
  box-shadow: 0 0 0 3px rgba(196, 75, 42, 0.12);
}

input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  accent-color: var(--cb-mid);
  box-shadow: none;
}

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

.name-grid,
.sel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.sel-grid {
  margin-top: 12px;
  gap: 14px;
}

.sel-card {
  position: relative;
  display: block;
  padding: 16px 18px 15px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fcfefe;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.sel-card:hover,
.sel-card.is-selected {
  border-color: var(--cb-main);
}

.sel-card.is-selected {
  background: var(--cb-mist);
  box-shadow: 0 0 0 3px rgba(0, 189, 182, 0.12);
}

body.event-uv .sel-card.is-selected {
  box-shadow: 0 0 0 3px rgba(196, 75, 42, 0.12);
}

.sel-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.sel-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.sel-radio {
  width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 2px solid #c3d3d3;
  border-radius: 50%;
}

.sel-card.is-selected .sel-radio {
  border-color: var(--cb-main);
}

.sel-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cb-main);
  transform: scale(0);
  transition: transform 0.15s;
}

.sel-card.is-selected .sel-dot {
  transform: scale(1);
}

.sel-title {
  color: var(--cb-dark);
  font-size: 15px;
  font-weight: 700;
}

.sel-sub {
  display: block;
  padding-left: 28px;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.6;
}

.sel-sub.inline {
  display: inline;
  padding-left: 0;
}

#team-block {
  margin-top: 20px;
}

.team-sub-label {
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 600;
}

.role-panel {
  margin-top: 16px;
  padding: 18px 20px;
  border-radius: 8px;
}

.role-panel-head {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 10px;
  font-size: 13.5px;
  font-weight: 700;
}

.role-panel.captain {
  border: 1px solid #e8dca6;
  border-left: 3px solid var(--stone);
  background: var(--stone-light);
}

.role-panel.captain,
.role-panel.captain .role-panel-head {
  color: var(--stone-deep);
}

.role-panel.member {
  border: 1px solid var(--border);
  border-left: 3px solid var(--cb-main);
  background: var(--cb-mist);
}

.role-panel.member .role-panel-head {
  color: var(--cb-mid);
}

.lead {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.85;
}

.code-input {
  color: var(--cb-dark);
  font-family: 'Inter', monospace !important;
  font-size: 18px !important;
  font-weight: 700 !important;
  letter-spacing: 0.08em;
  text-align: center;
  text-transform: uppercase;
}

.invite-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 10px;
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--cb-mid);
  font-size: 11px;
  font-weight: 700;
}

.code-match {
  display: none;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--cb-dark);
  font-size: 12.5px;
}

.code-match.show {
  display: flex;
}

.ok-ic {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--cb-mist);
  color: var(--cb-mid);
}

.team-rules-box {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

.team-rules,
.next-steps {
  list-style: none;
}

.team-rules {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-rules li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12.5px;
  line-height: 1.7;
}

.team-rules .dot {
  width: 6px;
  height: 6px;
  flex-shrink: 0;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--cb-main);
}

.radio-group {
  display: flex;
  gap: 32px;
  flex-wrap: nowrap;
  margin-top: 12px;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  white-space: nowrap;
  font-weight: 400;
}

.terms-agree {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  margin-top: 24px;
  padding: 14px 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--cb-mist);
}

.terms-agree input {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 4px;
}

.terms-agree label {
  margin: 0;
  color: var(--cb-dark);
  font-size: 13px;
  font-weight: 400;
  line-height: 1.7;
}

.form-actions {
  display: flex;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

button,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 43px;
  padding: 12px 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--cb-dark);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

button:hover,
.btn:hover {
  text-decoration: none;
}

.btn-primary {
  flex: 1;
  border-color: var(--cb-dark);
  background: var(--cb-dark);
  color: #fff;
}

.btn-primary:hover {
  border-color: #0a2138;
  background: #0a2138;
}

.btn-cta {
  width: 100%;
  border: 0;
  background: var(--cb-main);
  color: #fff;
  font-size: 16px;
}

.btn-cta:hover {
  background: var(--cb-mid);
  transform: translateY(-1px);
}

.btn-secondary {
  border-color: var(--cb-mid);
  color: var(--cb-mid);
  background: #fff;
}

.btn-secondary:hover {
  background: var(--cb-mist);
}

.kv {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fafdfd;
}

.kv-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13.5px;
}

.kv-row:last-child {
  border-bottom: 0;
}

.kv-row .k {
  width: 38%;
  flex-shrink: 0;
  color: var(--text-muted);
}

.kv-row .v {
  color: var(--cb-dark);
  font-weight: 700;
  text-align: right;
  word-break: break-word;
}

.notice-box,
.note-box,
.info-box,
.info-box-warn {
  padding: 16px 18px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.8;
}

.notice-box,
.info-box-warn {
  border: 1px solid #e8dca6;
  border-left: 3px solid var(--stone);
  background: var(--stone-light);
  color: var(--stone-deep);
}

.note-box,
.info-box {
  border: 1px solid var(--cb-pale);
  border-left: 3px solid var(--cb-main);
  background: var(--cb-mist);
  color: var(--cb-dark);
}

.addr-box {
  margin-bottom: 18px;
  padding: 16px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f4f6f8;
}

.addr-box .label {
  margin-bottom: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.addr-box .addr {
  color: var(--cb-dark);
  font-size: 15px;
  font-weight: 700;
  word-break: break-word;
}

.result-icon,
.check-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  border: 1px solid var(--cb-pale);
  border-radius: 50%;
  background: var(--cb-mist);
  color: var(--cb-mid);
}

.card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  color: var(--cb-dark);
  font-size: 20px;
  font-weight: 700;
}

.card-title.center {
  justify-content: center;
  text-align: center;
}

.card-sub {
  margin-bottom: 28px;
  color: var(--text-muted);
  font-size: 13px;
}

.badge-req {
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--cb-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
}

.password-field {
  position: relative;
}

.password-field .form-input {
  padding-right: 46px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 12px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  transform: translateY(-50%);
}

.pw-strength {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.pw-bar {
  height: 4px;
  flex: 1;
  border-radius: 2px;
  background: #e0e0e0;
  transition: background 0.3s;
}

.pw-bar.weak {
  background: #e53935;
}

.pw-bar.mid {
  background: #ffa726;
}

.pw-bar.strong {
  background: var(--cb-main);
}

.pw-strength-label {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.app-num-box,
.team-code-box {
  margin: 20px 0;
  padding: 16px 22px;
  border: 2px dashed #c6d8e0;
  border-radius: 8px;
  background: #f4f6f8;
  text-align: center;
}

.team-code-box {
  border-color: var(--cb-main);
  background: var(--cb-mist);
}

.app-num-label,
.team-code-label {
  margin-bottom: 5px;
  color: var(--text-muted);
  font-size: 12px;
}

.team-code-label {
  color: var(--cb-mid);
  font-weight: 700;
  letter-spacing: 0.06em;
}

.app-num,
.team-code {
  color: var(--cb-dark);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 2px;
}

.team-code {
  color: var(--cb-main);
  font-family: 'Courier New', monospace;
  font-size: 32px;
  letter-spacing: 6px;
}

.copy-row {
  display: flex;
  justify-content: center;
  margin-top: 12px;
}

.next-steps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  font-size: 13px;
}

.next-steps li:last-child {
  border-bottom: 0;
}

.ns-num {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--cb-main);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.preview-switcher {
  width: 100%;
  max-width: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 auto 16px;
}

.preview-switcher a {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.preview-switcher a.active {
  border-color: var(--cb-main);
  color: var(--cb-mid);
  background: var(--cb-mist);
}

.screen-wrap {
  width: 100%;
}

@media (max-width: 600px) {
  .site-header {
    height: auto;
    min-height: 60px;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .site-main {
    padding: 24px 12px 48px;
  }

  .form-header,
  .form-content,
  .flow-card {
    padding: 20px;
  }

  .name-grid,
  .sel-grid {
    grid-template-columns: 1fr;
  }

  .radio-group {
    gap: 24px;
  }

  .form-actions {
    flex-direction: column;
  }

  .kv-row .k {
    width: 42%;
  }
}

@media (max-width: 420px) {
  .site-footer .inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer .links a {
    padding-left: 0;
    padding-right: 10px;
  }

  .step-indicator {
    gap: 10px;
  }

  .kv-row {
    flex-direction: column;
    gap: 4px;
  }

  .kv-row .k,
  .kv-row .v {
    width: 100%;
    text-align: left;
  }
}
