:root {
  --bg: #f2f5f9;
  --surface: #ffffff;
  --surface-subtle: #f7f9fc;
  --border: #cbd5e1;
  --border-strong: #94a3b8;
  --text: #162231;
  --text-muted: #475569;
  --primary: #123966;
  --primary-hover: #0d2b4e;
  --focus: #1d5bbf;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fecdca;
  --info-bg: #eff6ff;
  --info-border: #bfdbfe;
  --info-text: #1e3a8a;
  --success: #0f5132;
  --success-bg: #ecfdf3;
  --success-border: #abefc6;
  --radius: 10px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--primary);
  color: #ffffff;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 700;
}

.skip-link:focus {
  left: 12px;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.site-header {
  background: var(--primary);
  color: #ffffff;
  border-bottom: 3px solid #0a2240;
}

.header-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.32);
  font-weight: 800;
  font-size: 14px;
  letter-spacing: 0.06em;
}

.header-titles {
  min-width: 0;
}

.header-kicker {
  margin: 0;
  font-size: 12px;
  opacity: 0.9;
}

.header-title {
  margin: 2px 0 0;
  font-size: clamp(18px, 4.2vw, 22px);
  line-height: 1.35;
  font-weight: 700;
}

.main-shell {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 16px 32px;
  display: grid;
  gap: 18px;
}

.intro-card,
.form-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.intro-card {
  background: var(--surface-subtle);
}

.section-heading {
  margin: 0 0 12px;
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  color: var(--primary);
}

.policy-list {
  margin: 0;
  padding-left: 20px;
  color: var(--text);
  font-size: 14px;
}

.policy-list li + li {
  margin-top: 6px;
}

.status-banner {
  margin-bottom: 18px;
  padding: 13px 15px;
  border-radius: 8px;
  border: 1px solid var(--info-border);
  background: var(--info-bg);
  color: var(--info-text);
  font-size: 14px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.status-banner[data-tone="error"] {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.status-banner[data-tone="success"] {
  border-color: var(--success-border);
  background: var(--success-bg);
  color: var(--success);
}

.field-group {
  margin-bottom: 18px;
}

.field-label {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 4px;
}

.req-badge {
  display: inline-block;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  background: #fee4e2;
  color: var(--danger);
}

.field-hint {
  margin: 0 0 6px;
  font-size: 13px;
  color: var(--text-muted);
}

input[type="text"],
input[type="email"],
input[type="password"] {
  display: block;
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  font-size: 16px;
  line-height: 1.4;
  font-family: inherit;
  color: var(--text);
  background: #ffffff;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  appearance: none;
}

input[aria-invalid="true"] {
  border-color: var(--danger);
  background: #fffafa;
}

.password-row {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.password-row input {
  flex: 1 1 auto;
  min-width: 0;
}

.password-toggle-btn {
  flex: 0 0 auto;
  min-width: 72px;
  min-height: 46px;
  padding: 0 14px;
  white-space: nowrap;
}

.field-error {
  margin: 6px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--danger);
}

.artifact-fieldset {
  margin: 22px 0 20px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.fieldset-legend {
  padding: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 4px;
}

.artifact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 8px;
}

.artifact-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 14px;
  min-height: 64px;
  border: 2px solid var(--border);
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: border-color 0.12s ease, background-color 0.12s ease;
}

.artifact-card:hover {
  border-color: var(--border-strong);
}

.artifact-card:has(input:checked) {
  border-color: var(--primary);
  background: #f0f6ff;
}

.artifact-card:has(input:focus-visible) {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.artifact-card input[type="radio"],
.artifact-card input[type="checkbox"] {
  margin: 3px 0 0;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  accent-color: var(--primary);
  cursor: pointer;
}

.artifact-card input[type="radio"]:focus-visible,
.artifact-card input[type="checkbox"]:focus-visible {
  outline: none;
}

.artifact-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.artifact-product {
  font-weight: 800;
  font-size: 15px;
  color: var(--primary);
}

.artifact-os {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
}

.artifact-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.submit-row {
  margin-top: 8px;
}

.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  border-radius: 8px;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

.primary-btn {
  width: 100%;
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.primary-btn:hover:not(:disabled) {
  background: var(--primary-hover);
}

.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 0.62;
  cursor: not-allowed;
}

.secondary-btn {
  border: 1px solid var(--border-strong);
  background: var(--surface-subtle);
  color: var(--text);
  font-size: 14px;
}

.secondary-btn:hover:not(:disabled) {
  background: #e2e8f0;
}

.download-panel {
  margin-top: 22px;
  padding: 18px;
  border-radius: var(--radius);
  border: 2px solid var(--success-border);
  background: var(--success-bg);
}

.download-heading {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--success);
}

.download-summary {
  margin: 0 0 14px;
  font-size: 14px;
  color: var(--text);
}

.download-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 12px;
}

.other-downloads-box {
  margin: 0 0 12px;
  padding: 10px 12px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
}

.other-downloads-summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
}

.other-downloads-list {
  margin-top: 10px;
  margin-bottom: 2px;
}

.download-link-btn {
  background: #0f6a3f;
  border-color: #0b5230;
}

.download-link-btn:hover {
  background: #0b5230;
}

.download-note {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 28px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

.site-footer p {
  margin: 0;
}

@media (max-width: 640px) {
  .header-inner {
    padding: 14px 16px;
  }

  .main-shell {
    padding: 14px 12px 24px;
    gap: 14px;
  }

  .intro-card,
  .form-card {
    padding: 16px 14px;
  }

  .artifact-grid {
    grid-template-columns: 1fr;
  }
}
