:root {
  --navy-950: #102d36;
  --navy-800: #1a4651;
  --teal-700: #176a69;
  --teal-600: #1a7b76;
  --teal-100: #dff2ef;
  --teal-50: #f2faf8;
  --ink: #173239;
  --muted: #5e7277;
  --line: #d7e3e2;
  --surface: #ffffff;
  --canvas: #f4f8f7;
  --yellow: #ffd84a;
  --yellow-soft: #fff7cf;
  --danger: #a43838;
  --danger-soft: #fff3f2;
  --success: #1f6f59;
  --shadow: 0 20px 55px rgba(20, 61, 70, 0.10);
  --radius-lg: 24px;
  --radius-md: 16px;
  font-family: "Yu Gothic UI", "Hiragino Kaku Gothic ProN", "Meiryo", system-ui, sans-serif;
  color: var(--ink);
  background: var(--canvas);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 88% 3%, rgba(46, 151, 139, 0.12), transparent 27rem),
    linear-gradient(180deg, #f8fbfa 0%, var(--canvas) 38rem);
  line-height: 1.7;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

:focus-visible {
  outline: 3px solid #0d5fb8;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy-950);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  border-bottom: 1px solid rgba(23, 106, 105, 0.12);
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(12px);
}

.header-inner,
.page-shell {
  width: min(1120px, calc(100% - 40px));
  margin-inline: auto;
}

.header-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.identity {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  font-size: 0.92rem;
  color: var(--muted);
}

.identity strong {
  color: var(--navy-950);
}

.local-badge {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--teal-700);
  font-size: 0.86rem;
  font-weight: 700;
}

.local-badge span {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #31a47f;
  box-shadow: 0 0 0 5px rgba(49, 164, 127, 0.12);
}

.hero {
  padding: 72px 0 48px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  align-items: center;
  gap: 64px;
}

.eyebrow,
.step-label,
.rule-kicker,
.success-label {
  margin: 0 0 10px;
  color: var(--teal-700);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 760px;
  color: var(--navy-950);
  font-size: clamp(2.25rem, 5.5vw, 4.3rem);
  line-height: 1.18;
  letter-spacing: -0.045em;
}

.lead {
  max-width: 690px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
}

.rule-card {
  padding: 28px;
  border: 1px solid rgba(23, 106, 105, 0.13);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.rule-card h2 {
  margin: 0 0 18px;
  color: var(--navy-950);
  font-size: 1.45rem;
}

.rule-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.rule-card li {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.rule-card li > span {
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--teal-600);
  font-weight: 900;
}

.rule-card .yellow-dot {
  background: var(--yellow);
  box-shadow: inset 0 0 0 1px rgba(112, 88, 0, 0.18);
}

.rule-card strong,
.rule-card small {
  display: block;
}

.rule-card small {
  margin-top: 2px;
  color: var(--muted);
}

.workspace-card {
  padding: clamp(24px, 5vw, 52px);
  border: 1px solid rgba(23, 106, 105, 0.12);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.section-heading {
  max-width: 760px;
}

.section-heading h2,
.how-it-works h2 {
  margin: 0;
  color: var(--navy-950);
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.3;
}

.section-heading > p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
}

.upload-grid {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.upload-card {
  min-width: 0;
  padding: 24px;
  border: 2px dashed #b8d1ce;
  border-radius: var(--radius-md);
  background: var(--teal-50);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.upload-card:focus-within,
.upload-card.has-file {
  border-style: solid;
  border-color: var(--teal-600);
  background: #f7fcfb;
}

.upload-card.has-file {
  transform: translateY(-2px);
}

.upload-card.has-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.upload-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}

.upload-number {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #fff;
  background: var(--navy-800);
  font-weight: 800;
}

.required-label {
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--teal-700);
  background: var(--teal-100);
  font-size: 0.72rem;
  font-weight: 800;
}

.upload-card label {
  display: block;
  color: var(--navy-950);
  font-size: 1.18rem;
  font-weight: 800;
}

.upload-card > p {
  min-height: 3.4em;
  margin: 7px 0 16px;
  color: var(--muted);
  font-size: 0.9rem;
}

input[type="file"] {
  width: 100%;
  min-height: 48px;
  padding: 7px;
  border: 1px solid #aac5c2;
  border-radius: 11px;
  color: var(--ink);
  background: #fff;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 10px;
  padding: 6px 13px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--teal-700);
  font-weight: 700;
  cursor: pointer;
}

.upload-card .file-state {
  min-height: auto;
  margin: 12px 0 0;
  color: var(--navy-800);
  font-size: 0.84rem;
  font-weight: 700;
}

.upload-card .field-error {
  min-height: auto;
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.84rem;
  font-weight: 700;
}

.action-row {
  margin-top: 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.privacy-note {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.privacy-note p {
  margin: 0;
  font-size: 0.9rem;
}

.privacy-note span {
  color: var(--muted);
}

.privacy-note .shield {
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px 9px 12px 12px;
  color: #fff;
  background: var(--teal-600);
  font-weight: 900;
}

.primary-button,
.secondary-button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: transform 150ms ease, box-shadow 150ms ease, opacity 150ms ease;
}

.primary-button {
  border: 1px solid var(--teal-700);
  color: #fff;
  background: var(--teal-700);
  box-shadow: 0 10px 24px rgba(23, 106, 105, 0.18);
}

.primary-button:not(:disabled):hover,
.secondary-button:hover {
  transform: translateY(-1px);
}

.primary-button:disabled {
  color: #829395;
  border-color: #d8e0df;
  background: #edf1f0;
  box-shadow: none;
  cursor: not-allowed;
}

.secondary-button {
  border: 1px solid #aac3c0;
  color: var(--navy-800);
  background: #fff;
}

.state-panel {
  min-height: 150px;
  margin-top: 28px;
  padding: 24px;
  border-radius: var(--radius-md);
}

.state-panel[hidden] {
  display: none;
}

.state-panel h3 {
  margin: 0;
  color: var(--navy-950);
  font-size: 1.25rem;
}

.state-panel p {
  margin: 6px 0 0;
}

.progress-panel,
.error-panel,
.success-panel {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.progress-panel {
  background: var(--teal-50);
}

.spinner {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border: 4px solid var(--teal-100);
  border-top-color: var(--teal-700);
  border-radius: 50%;
  animation: spin 850ms linear infinite;
}

.progress-track {
  width: min(480px, 100%);
  height: 8px;
  margin-top: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: #d9e9e6;
}

.progress-track span {
  display: block;
  width: 38%;
  height: 100%;
  border-radius: inherit;
  background: var(--teal-600);
  animation: progress 1.5s ease-in-out infinite;
}

.error-panel {
  color: #723333;
  border: 1px solid #efc7c3;
  background: var(--danger-soft);
}

.state-icon {
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--danger);
  font-size: 1.15rem;
  font-weight: 900;
}

.error-panel .secondary-button {
  margin-top: 18px;
}

.success-panel {
  border: 1px solid #ead990;
  background: var(--yellow-soft);
}

.success-panel .state-icon {
  color: #614b00;
  background: var(--yellow);
}

.success-copy {
  width: 100%;
}

.success-label {
  margin-bottom: 2px;
  color: #725800;
}

.result-stats {
  margin: 22px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.result-stats div {
  padding: 13px 15px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.72);
}

.result-stats dt {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-stats dd {
  margin: 0;
  color: var(--navy-950);
  font-size: 1.05rem;
  font-weight: 900;
}

.success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.how-it-works {
  padding: 68px 0 76px;
}

.how-it-works ol {
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.how-it-works li {
  min-height: 160px;
  padding: 22px;
  display: flex;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.66);
}

.how-it-works li > span {
  color: var(--teal-600);
  font-size: 0.84rem;
  font-weight: 900;
}

.how-it-works strong {
  color: var(--navy-950);
  font-size: 1.06rem;
}

.how-it-works p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

footer {
  padding: 22px 20px;
  color: #dbe9e8;
  text-align: center;
  background: var(--navy-950);
  font-size: 0.84rem;
}

footer p {
  margin: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes progress {
  0% { transform: translateX(-115%); }
  55% { transform: translateX(105%); }
  100% { transform: translateX(285%); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (max-width: 820px) {
  .header-inner {
    padding-block: 12px;
    align-items: flex-start;
    flex-direction: column;
    gap: 7px;
  }

  .hero {
    padding-top: 48px;
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .upload-grid,
  .how-it-works ol {
    grid-template-columns: 1fr;
  }

  .action-row {
    align-items: stretch;
    flex-direction: column;
  }

  .action-row .primary-button {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .page-shell {
    width: min(100% - 24px, 1120px);
  }

  .identity {
    gap: 4px 14px;
    flex-direction: column;
  }

  .hero {
    padding-top: 38px;
  }

  h1 {
    font-size: 2.2rem;
  }

  .workspace-card {
    padding: 22px 16px;
    border-radius: 20px;
  }

  .upload-card {
    padding: 18px;
  }

  .result-stats {
    grid-template-columns: 1fr;
  }

  .success-actions,
  .success-actions > * {
    width: 100%;
  }
}
