:root {
  --bg: #050816;
  --card: rgba(21, 17, 76, 0.55);
  --card-soft: rgba(21, 17, 76, 0.36);
  --panel: rgba(11, 15, 42, 0.48);
  --stroke: rgba(91, 91, 135, 0.34);
  --cyan: #2ee6ff;
  --violet: #8b5cff;
  --green: #3cffb2;
  --red: #ff5c98;
  --text: #ffffff;
  --muted: #c9ceda;
  --disabled: rgba(42, 46, 63, 0.86);
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: Inter, sans-serif;
  color: var(--text);
  background: var(--bg);
}

button,
input,
summary {
  font: inherit;
}

button,
summary {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  object-fit: contain;
}
main {
  position: relative;
  width: 100%;
  min-height: 100dvh;
  overflow: hidden;
  padding: clamp(18px, 3vw, 28px) clamp(20px, 3.4vw, 48px);
  background: var(--bg);
}

main::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 70% 55% at 20% 8%,
      rgba(46, 230, 255, 0.28) 0%,
      rgba(46, 230, 255, 0.14) 28%,
      rgba(46, 230, 255, 0.04) 52%,
      transparent 72%
    ),
    radial-gradient(
      ellipse 62% 48% at 82% 10%,
      rgba(139, 92, 255, 0.30) 0%,
      rgba(139, 92, 255, 0.14) 30%,
      rgba(139, 92, 255, 0.04) 56%,
      transparent 76%
    ),
    radial-gradient(
      ellipse 64% 44% at 50% 95%,
      rgba(60, 255, 178, 0.24) 0%,
      rgba(60, 255, 178, 0.12) 30%,
      rgba(60, 255, 178, 0.04) 58%,
      transparent 78%
    ),
    linear-gradient(
      135deg,
      #06111a 0%,
      #071225 32%,
      #09081f 64%,
      #05040c 100%
    );
}

main > * {
  position: relative;
  z-index: 1;
}

header {
  min-height: clamp(64px, 5vw, 72px);
  display: flex;
  align-items: center;
  padding: 0 clamp(16px, 2vw, 24px);
  border: 1px solid rgba(91, 91, 135, 0.18);
  border-radius: 22px;
}

header a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(18px, 1.5vw, 20px);
  font-weight: 800;
}

header img,
.outline img,
summary img,
li img {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
}
main > section {
  width: 100%;
  margin-top: clamp(18px, 2vw, 26px);
  display: grid;
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

main > section:not(.result) {
  grid-template-columns: minmax(460px, 1fr) minmax(360px, 0.95fr);
}

.result {
  grid-template-columns: minmax(520px, 0.68fr) minmax(360px, 0.32fr);
}

main > section > article,
form {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.3vw, 16px);
}

form {
  padding-top: clamp(54px, 6.2vw, 88px);
  gap: 12px;
}

aside {
  min-width: 0;
  padding-top: clamp(48px, 5.4vw, 72px);
}

h1 {
  margin: 0;
  max-width: 800px;
  font-size: clamp(36px, 4.1vw, 56px);
  line-height: 1.04;
  letter-spacing: -0.065em;
}

p {
  margin: clamp(2px, 1.4vw, 4px) 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: clamp(14px, 1.35vw, 18px);
  line-height: 1.45;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.outline,
.start,
.new-analysis {
  min-height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: var(--text);
}

.outline {
  min-width: clamp(200px, 16vw, 230px);
  padding: 0 clamp(18px, 2vw, 24px);
  gap: 8px;
  background: rgba(21, 17, 76, 0.22);
  font-size: clamp(18px, 1.35vw, 20px);
  font-weight: 700;
  backdrop-filter: blur(12px);
  transition:
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.outline:hover {
  background: rgba(21, 17, 76, 0.34);
}

.outline.violet {
  border: 1px solid rgba(139, 92, 255, 0.34);
}

.outline.cyan {
  border: 1px solid rgba(46, 230, 255, 0.30);
}

.outline.violet:hover {
  border-color: rgba(139, 92, 255, 0.54);
  box-shadow: 0 0 30px rgba(139, 92, 255, 0.24), var(--shadow);
}

.outline.cyan:hover {
  border-color: rgba(46, 230, 255, 0.48);
  box-shadow: 0 0 28px rgba(46, 230, 255, 0.22), var(--shadow);
}

.start {
  width: fit-content;
  min-width: 190px;
  padding: 0 28px;
  color: rgba(201, 206, 218, 0.72);
  background: var(--disabled);
  cursor: not-allowed;
  transition:
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.start:not(:disabled),
.new-analysis {
  color: var(--text);
  background: linear-gradient(135deg, var(--cyan), var(--violet));
  box-shadow: 0 0 32px rgba(46, 230, 255, 0.22), var(--shadow);
  cursor: pointer;
}

.start:not(:disabled):hover,
.new-analysis:hover {
  box-shadow:
    0 0 42px rgba(46, 230, 255, 0.32),
    0 0 28px rgba(139, 92, 255, 0.22),
    var(--shadow);
}

.new-analysis {
  width: fit-content;
  min-width: 190px;
  padding: 0 28px;
  font-size: 15px;
  font-weight: 700;
}

.upload {
  position: relative;
  width: 100%;
  height: clamp(300px, 33vw, 420px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow: hidden;
  border: 1.4px solid rgba(139, 92, 255, 0.7);
  border-radius: clamp(24px, 2.4vw, 34px);
  background:
    radial-gradient(circle at 50% 40%, rgba(139, 92, 255, 0.22), transparent 32%),
    linear-gradient(135deg, rgba(21, 17, 76, 0.7), rgba(11, 15, 42, 0.36));
  box-shadow: 0 0 38px rgba(139, 92, 255, 0.18), var(--shadow);
  backdrop-filter: blur(14px);
  cursor: pointer;
}

.upload:hover {
  border-color: rgba(46, 230, 255, 0.72);
  box-shadow: 0 0 46px rgba(46, 230, 255, 0.2), var(--shadow);
}

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

.preview {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  display: none;
  object-fit: cover;
  border-radius: inherit;
}

.upload.has-image .preview {
  display: block;
}

.upload.has-image::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
  background:
    linear-gradient(180deg, rgba(5, 8, 22, 0.08), rgba(5, 8, 22, 0.38)),
    radial-gradient(circle at center, transparent, rgba(5, 8, 22, 0.46));
}

.upload span,
.upload i {
  position: relative;
  z-index: 2;
}

.upload span {
  display: grid;
  gap: 8px;
  text-align: center;
}

.upload strong {
  font-size: clamp(18px, 1.7vw, 24px);
}

.upload small {
  color: var(--muted);
  font-size: clamp(14px, 1.25vw, 18px);
}

.upload i {
  position: absolute;
  width: 18px;
  height: 18px;
  color: var(--cyan);
}

.upload i:nth-of-type(1) {
  left: 22px;
  top: 22px;
  border-left: 3px solid;
  border-top: 3px solid;
}

.upload i:nth-of-type(2) {
  right: 22px;
  top: 22px;
  border-right: 3px solid;
  border-top: 3px solid;
}

.upload i:nth-of-type(3) {
  left: 22px;
  bottom: 22px;
  border-left: 3px solid;
  border-bottom: 3px solid;
}

.upload i:nth-of-type(4) {
  right: 22px;
  bottom: 22px;
  border-right: 3px solid;
  border-bottom: 3px solid;
}

details {
  position: relative;
  width: 100%;
}

summary {
  width: 100%;
  min-height: 66px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  list-style: none;
  border: 1px solid var(--stroke);
  border-radius: 20px;
  color: var(--text);
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

summary::-webkit-details-marker {
  display: none;
}

details[open] summary {
  border-color: rgba(46, 230, 255, 0.62);
}

summary span {
  flex: 1;
  display: grid;
  gap: 3px;
}

summary::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: auto;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-top: 14px solid var(--muted);
}

details[open] summary::after {
  transform: rotate(180deg);
}

small {
  color: rgba(201, 206, 218, 0.72);
  font-size: 12px;
  line-height: 1;
}

b {
  color: var(--text);
  font-size: clamp(15px, 1.2vw, 17px);
  line-height: 1.15;
}

ul {
  position: absolute;
  z-index: 20;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 10px;
  list-style: none;
  border: 1px solid rgba(46, 230, 255, 0.34);
  border-radius: 20px;
  background:
    radial-gradient(circle at 35% 10%, rgba(46, 230, 255, 0.12), transparent 38%),
    linear-gradient(135deg, rgba(11, 15, 42, 0.98), rgba(21, 17, 76, 0.96));
  box-shadow: 0 26px 72px rgba(0, 0, 0, 0.45), 0 0 34px rgba(46, 230, 255, 0.14);
  backdrop-filter: blur(18px);
}

li button {
  width: 100%;
  min-height: 44px;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 14px;
  color: var(--text);
  background: var(--card-soft);
  text-align: left;
}

li button:hover {
  background: rgba(46, 230, 255, 0.11);
}

mark {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--cyan);
  box-shadow: 0 0 14px rgba(46, 230, 255, 0.58);
}

.verdict {
  width: fit-content;
  min-width: min(100%, 330px);
  max-width: 620px;
  min-height: 92px;
  padding: 18px 24px;
  display: inline-flex;
  align-items: center;
  gap: 18px;
  border-radius: 26px;
  background: rgba(21, 17, 76, 0.42);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.verdict img {
  width: 64px;
  height: 64px;
}

.verdict span {
  display: grid;
  gap: 4px;
}

.verdict strong {
  font-size: clamp(20px, 2vw, 28px);
  line-height: 1;
  text-transform: uppercase;
}

.verdict small {
  color: var(--text);
  font-size: clamp(13px, 1.15vw, 16px);
}

.verdict.success {
  border: 2px solid var(--green);
  box-shadow: 0 0 34px rgba(60, 255, 178, 0.18), var(--shadow);
}

.verdict.success strong {
  color: var(--green);
}

.verdict.danger {
  border: 2px solid var(--red);
  box-shadow: 0 0 34px rgba(255, 92, 152, 0.2), var(--shadow);
}

.verdict.danger strong {
  color: var(--text);
}

dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.metric {
  min-height: 86px;
  padding: 18px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(11, 15, 42, 0.42);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.metric::before {
  content: "";
  width: 100%;
  height: 12px;
  grid-column: 1 / -1;
  grid-row: 2;
  border: 1px solid rgba(91, 91, 135, 0.16);
  border-radius: 999px;
  background:
    linear-gradient(
      90deg,
      currentColor 0 var(--value),
      rgba(21, 17, 76, 0.6) var(--value) 100%
    );
}

.metric.cyan {
  color: var(--cyan);
}

.metric.violet {
  color: var(--violet);
}

.metric dt,
.metric dd {
  margin: 0;
  color: var(--text);
  font-size: clamp(14px, 1.2vw, 16px);
  font-weight: 600;
}

.result details {
  border: 1px solid var(--stroke);
  border-radius: 22px;
  background: rgba(11, 15, 42, 0.42);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.result details > section {
  width: auto;
  margin: 0;
  padding: 4px 18px 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.result details article {
  min-height: 92px;
  padding: 14px;
  display: block;
  border: 1px solid rgba(91, 91, 135, 0.18);
  border-radius: 18px;
  background: var(--card-soft);
}

.result details article:last-child {
  grid-column: 1 / -1;
}

h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.result details b {
  display: block;
  margin-top: 8px;
  color: var(--green);
  font-size: 20px;
  line-height: 1;
}

.result details p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

@media (min-width: 1600px) {
  main > section:not(.result) {
    grid-template-columns: minmax(620px, 0.92fr) minmax(520px, 0.86fr);
  }

  form {
    padding-top: 94px;
  }
}

@media (max-width: 1100px) {
  main > section,
  .result {
    grid-template-columns: 1fr;
  }

  form,
  aside {
    max-width: 720px;
    padding-top: 4px;
  }

  .upload {
    max-width: 760px;
  }
}

@media (max-width: 640px) {
  main {
    padding: 18px 24px;
  }

  header {
    min-height: 64px;
    border-radius: 18px;
  }

  header a {
    font-size: 18px;
  }

  header img,
  .outline img,
  summary img,
  li img {
    width: 22px;
    height: 22px;
  }

  main > section {
    display: block;
    margin-top: 18px;
  }

  h1 {
    font-size: clamp(28px, 8vw, 34px);
    line-height: 1.1;
  }

  p {
    max-width: 310px;
    margin-top: 12px;
    font-size: 13px;
  }

  nav {
    margin-top: 18px;
    gap: 8px;
  }

  .outline {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    min-height: 39px;
    padding: 0 10px;
    border-radius: 12px;
    font-size: 12px;
  }

  .upload {
    height: clamp(245px, 66vw, 285px);
    margin-top: 14px;
    border-radius: 26px;
  }

  .upload strong {
    font-size: 15px;
  }

  .upload small {
    font-size: 12px;
  }

  form {
    padding-top: 16px;
  }

  summary {
    min-height: 58px;
    padding: 10px 14px;
    border-radius: 18px;
  }

  small {
    font-size: 11px;
  }

  b {
    font-size: 15px;
  }

  ul {
    position: relative;
    top: auto;
    margin-top: 8px;
  }

  .verdict {
    width: 100%;
    min-width: 0;
    padding: 18px;
  }

  aside,
  dl,
  .new-analysis {
    margin-top: 16px;
  }

  .result details > section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 16px 16px;
  }

  .result details article {
    min-height: 104px;
  }

  .result details article:last-child {
    grid-column: auto;
  }
}

@media (max-width: 430px) {
  .result details > section {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 380px) {
  main {
    padding-inline: 18px;
  }

  nav {
    flex-direction: column;
  }

  .outline {
    width: 100%;
  }
}