:root {
  --accent: #4abae8;
  --accent-dark: #178fbd;
  --accent-soft: #eaf8fd;
  --bg: #f6f8fb;
  --card: #ffffff;
  --ink: #121a24;
  --muted: #647181;
  --line: #dbe5ee;
  --navy: #172333;
  --success: #1f8a4c;
  --warning: #b87918;
  --danger: #c43b2f;
  --shadow: 0 8px 24px rgba(23, 35, 51, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(74, 186, 232, 0.08), rgba(243, 247, 251, 0) 260px),
    var(--bg);
  font-size: 15px;
  font-family: Inter, Arial, Helvetica, sans-serif;
}

a {
  color: inherit;
}

.tool-header {
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.tool-header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 58px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.brand-icon {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  box-shadow: inset 0 -4px 0 var(--accent);
  font-weight: 900;
  font-size: 0.72rem;
}

.brand-mark strong {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
}

.brand-mark small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.header-link,
.reset-link {
  flex: 0 0 auto;
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 800;
  text-decoration: none;
}

.page-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 16px auto 32px;
}

.hero-panel {
  min-height: 210px;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: end;
  background:
    linear-gradient(90deg, rgba(18, 26, 36, 0.88), rgba(18, 26, 36, 0.42)),
    url("assets/iphone-authenticity-checker.png") center / cover no-repeat;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-copy {
  max-width: 680px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 0;
  max-width: 600px;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: 0;
}

.hero-copy p {
  max-width: 620px;
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.98rem;
  line-height: 1.5;
}

.hero-side {
  display: grid;
  gap: 10px;
}

.hero-flow,
.hero-status {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(16px);
}

.hero-flow .eyebrow {
  color: var(--accent);
}

.hero-flow h2 {
  font-size: 1.08rem;
  line-height: 1.2;
}

.hero-flow .flow-list {
  margin: 8px 0 0;
  padding-left: 18px;
  display: block;
  color: rgba(255, 255, 255, 0.78);
  list-style: decimal;
}

.hero-flow .flow-list li {
  font-size: 0.78rem;
  line-height: 1.35;
}

.hero-flow .flow-list li + li {
  margin-top: 5px;
}

.hero-status span,
.criteria-score span {
  display: block;
  margin-bottom: 6px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.hero-status strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 1.22rem;
}

.hero-status p {
  margin: 6px 0 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.88rem;
  line-height: 1.4;
}

.workspace-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 16px;
  align-items: start;
}

.main-column {
  display: grid;
  gap: 16px;
}

.tool-card,
.side-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.tool-card {
  padding: 18px;
}

.section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.section-heading.compact {
  margin-bottom: 10px;
}

h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h2 {
  font-size: 1.28rem;
}

h3 {
  font-size: 0.95rem;
}

.notice-stack {
  margin-bottom: 14px;
  display: grid;
  gap: 10px;
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 8px;
  line-height: 1.45;
}

.notice-error {
  color: var(--danger);
  background: #fff1f0;
  border: 1px solid #ffd0cc;
}

.notice-success {
  color: var(--success);
  background: #eefbf2;
  border: 1px solid #c5f0d0;
}

.serial-form {
  display: grid;
  gap: 14px;
}

.input-grid,
.criteria-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.input-card {
  min-height: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

label {
  display: grid;
  gap: 7px;
}

label span {
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 850;
}

input[name="serial"],
select {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid #c7d4df;
  border-radius: 7px;
  color: var(--ink);
  background: #fff;
  font: inherit;
}

input[name="serial"] {
  font-weight: 900;
  letter-spacing: 0.06em;
}

input:focus,
select:focus {
  outline: 3px solid rgba(74, 186, 232, 0.2);
  border-color: var(--accent);
}

input.is-valid {
  border-color: var(--success);
}

input.is-invalid {
  border-color: var(--danger);
}

.serial-feedback {
  margin: 8px 0 0;
  font-size: 0.84rem;
  font-weight: 750;
  line-height: 1.4;
}

.serial-feedback.good {
  color: var(--success);
}

.serial-feedback.bad {
  color: var(--danger);
}

.serial-feedback.neutral,
.serial-feedback.warn {
  color: var(--muted);
}

.input-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.upload-zone {
  min-height: 108px;
  padding: 18px;
  border: 1px dashed #9eb7c8;
  border-radius: 8px;
  display: grid;
  align-content: center;
  background: var(--accent-soft);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid transparent;
  border-radius: 7px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.button-primary {
  color: #fff;
  background: var(--accent);
}

.button-secondary {
  color: var(--ink);
  border-color: var(--line);
  background: #fff;
}

.button-dark {
  color: #fff;
  background: var(--navy);
}

.button:disabled,
.button.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.photo-review {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.zoom-control {
  min-width: 220px;
}

.zoom-control span {
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
}

.photo-frame {
  max-height: 520px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fafc;
}

.photo-frame img {
  width: 100%;
  max-width: none;
  display: block;
  transform-origin: top left;
}

.criteria-score {
  min-width: 112px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  text-align: right;
}

.criteria-score strong {
  display: block;
  font-size: 1.55rem;
  line-height: 1;
}

.criteria-result {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.criteria-meter {
  height: 9px;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf3;
}

.criteria-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 180ms ease, background 180ms ease;
}

.risk-fill-high {
  background: var(--danger) !important;
}

.risk-fill-medium {
  background: var(--warning) !important;
}

.risk-fill-low {
  background: var(--success) !important;
}

.criteria-result p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.criteria-result ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.4;
}

.criteria-result li + li {
  margin-top: 5px;
}

.side-panel {
  position: sticky;
  top: 14px;
  display: grid;
  gap: 12px;
}

.side-card {
  padding: 16px;
}

.side-card-dark {
  color: #fff;
  background: var(--navy);
}

.side-card-dark .eyebrow {
  color: var(--accent);
}

.flow-list,
.check-list {
  margin: 10px 0 0;
  padding-left: 20px;
  line-height: 1.45;
}

.flow-list {
  color: rgba(255, 255, 255, 0.78);
}

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

.flow-list li + li,
.check-list li + li {
  margin-top: 6px;
}

.quick-links {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.quick-links a {
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--ink);
  background: #fff;
  font-weight: 850;
  text-decoration: none;
}

.quick-links a::after {
  content: ">";
  color: var(--accent-dark);
}

.seo-content {
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.seo-intro {
  max-width: 880px;
}

.seo-intro h2,
.faq-section h2 {
  margin: 0;
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.seo-intro p,
.seo-grid p,
.faq-section p {
  color: var(--muted);
  line-height: 1.55;
}

.seo-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.seo-grid article {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.seo-grid h3 {
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.seo-grid p {
  margin: 0;
}

.faq-section {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.faq-section details {
  border-bottom: 1px solid var(--line);
}

.faq-section summary {
  padding: 12px 0;
  color: var(--ink);
  font-weight: 900;
  cursor: pointer;
}

.faq-section details p {
  margin: 0;
  padding: 0 0 12px;
}

@media (max-width: 980px) {
  .tool-header-inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .hero-panel,
  .workspace-grid {
    grid-template-columns: 1fr;
  }

  .side-panel {
    position: static;
  }
}

@media (max-width: 680px) {
  .tool-header-inner,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-shell,
  .tool-header-inner {
    width: min(100% - 20px, 1180px);
  }

  .hero-panel,
  .tool-card,
  .side-card {
    border-radius: 8px;
    padding: 14px;
  }

  .hero-copy h1 {
    font-size: 2rem;
  }

  .input-grid,
  .criteria-grid,
  .seo-grid {
    grid-template-columns: 1fr;
  }

  .button-row > *,
  .criteria-score {
    width: 100%;
  }

  .criteria-score {
    text-align: left;
  }

  .zoom-control {
    min-width: 0;
  }
}
