html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
}

:root {
  --bg: #0d0f12;
  --card: #141821;
  --ink: #e9eef6;
  --muted: #97a3b6;
  --accent: #ffd65a;
  --accent-ink: #1c1c1c;
  --ok: #4ade80;
  --warn: #f97316;


  --main-color-gray-1: #FFF;
  --main-color-gray-2: #FAFAFA;
  --main-color-gray-3: #F5F5F5;
  --main-color-gray-4: #E8E8E8;
  --main-color-gray-5: #D9D9D9;
  --main-color-gray-6: #BFBFBF;
  --main-color-gray-7: #8C8C8C;
  --main-color-gray-8: #595959;
  --main-color-gray-9: #262626;
  --main-color-gray-10: #000;

  --main-color-green-1: #5FB05F;
  --main-color-green-2: #3FA443;
  --main-color-green-3: #297D2F;

  --main-color-red-1: #FF7875;
  --main-color-red-2: #FF4D4F;
  --main-color-red-3: #D9363E;

  --main-color-orange-1: #FFBA3B;
  --main-color-orange-2: #FFA313;
  --main-color-orange-3: #D98004;

  --main-color-yellow-1: #FBE66A;
  --main-color-yellow-2: #FADB14;
  --main-color-yellow-3: #EFD030;

}

* {
  box-sizing: border-box;
}

@import url('https://fonts.googleapis.com/css2?family=Rubik:wght@400;500;700&display=swap');

body {
  margin: 0;
  font-family: 'Rubik', sans-serif;
  background: var(--main-color-gray-3);
}

p {
  color: var(--main-color-gray-8);
  font-size: 20px;
  line-height: 28px;
}

.wrap {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 24px;
  gap: 24px;
  flex-direction: column;
}

.card {
  width: 100%;
  max-width: 600px;
  background: var(--main-color-gray-1);
  border: 2px solid var(--main-color-gray-4);
  border-radius: 32px;
  padding: 24px;
  transition: opacity .5s ease, height .5s ease;
  will-change: height, opacity;
  min-height: 501px;
}

.head {
  display: none;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  flex-direction: column;
}

.logo {
  padding: 12px 16px;
  border: 2px solid;
  border-radius: 100px;
  border-color: var(--main-color-gray-4);
  background: var(--main-color-gray-1);
  display: flex;
  place-items: center;
}

h1 {
  font-weight: 600;
  font-size: 20px;
  line-height: 28px;
  margin: 0;
  color: var(--main-color-gray-9);
}

.muted {
  color: var(--main-color-gray-7);
  font-size: 16px;
  line-height: 24px;
  text-align: center;
}

/* Progress */
.progress {
  height: 8px;
  background: var(--main-color-gray-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 20px;
}

.bar {
  height: 100%;
  width: 0%;
  background: var(--main-color-green-2);
  transition: width .25s ease;
}

/* Question wrap */
.qwrap {
  min-height: 378px;
}

/* Question box */
.qbox {
  padding: 0px;
  will-change: height, opacity;
}

.qtext {
  color: var(--main-color-gray-8);
  font-size: 18px;
  line-height: 1.5;
  margin: 0 0 12px;
  text-align: center;
}

.answers {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.opt {
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    border: 2px solid var(--main-color-gray-3);
    background: var(--main-color-gray-2);
    border-radius: 16px;
    cursor: pointer;
}

.opt:hover {
    background: var(--main-color-gray-3);
}

.opt input {
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--main-color-green-2);
  display: inline-block;
  position: relative;
}

.opt input:checked {
  border-color: var(--main-color-green-3);
}

.opt input:checked::after {
  content: "";
  position: absolute;
  inset: 4px;
  background: var(--main-color-green-3);
  border-radius: 50%;
}

.phone-input.is-invalid { 
  outline: 2px solid var(--main-color-red-2); 
}

/* Buttons & layout */
.buttons {
  display: flex;
  gap: 16px;
  margin: 24px 0 0;
  flex-wrap: wrap;
  justify-content: center;
}

.btn {
  width: 100%;
  font-size: 16px;
  max-width: 266px;
  appearance: none;
  border: none;
  padding: 16px 24px;
  border-radius: 100px;
  border: 2px solid;
  background: var(--main-color-green-2);
  color: var(--main-color-gray-1);
  font-weight: 600;
  cursor: pointer;
}

.btn[disabled] {
  opacity: .5;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--main-color-green-2);
  border-color: var(--main-color-green-1);
  color: var(--main-color-gray-1);
}

.btn.primary:hover {
  background: var(--main-color-green-1);
  transition: background 0.2s ease;
}

.btn.gray {
  background: var(--main-color-gray-2);
  border-color: var(--main-color-gray-3);
  color: var(--main-color-gray-9);
}

.btn.gray:hover {
  background: var(--main-color-gray-1);
  transition: background 0.2s ease;
}

.btn.small {
  background: var(--main-color-green-2);
  border-color: var(--main-color-green-1);
  color: var(--main-color-gray-1);
  width: fit-content;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
}

.btn.small:hover {
  background: var(--main-color-green-1);
  transition: background 0.2s ease;
}

.footer-note {
  margin-top: 8px;
  font-size: 14px;
  line-height: 22px;
  color: var(--main-color-gray-7);
  text-align: center;
}

/* Lead form */
.lead {
  display: none;
  margin-top: 14px;
}

.lead h3 {
  margin: 0 0 16px;
  font-size: 18px;
  line-height: 24px;
  font-weight: 600;
  color: var(--main-color-gray-9);
  text-align: center;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

label {
  font-size: 16px;
  font-weight: 500;
  color: var(--main-color-gray-8);
}

input[type="text"],
input[type="email"],
input[type="tel"] {
  background: var(--main-color-gray-2);
  border: 2px solid var(--main-color-gray-3);
  border-radius: 16px;
  padding: 12px;
  color: var(--main-color-gray-9);
  font-size: 16px;
  line-height: 24px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Ховер */
input[type="text"]:hover,
input[type="email"]:hover,
input[type="tel"]:hover {
  border-color: var(--main-color-gray-5);
}

/* Активний (focus) */
input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus {
  outline: none;
  border-color: var(--main-color-green-2);
  box-shadow: 0 0 0 3px rgba(63, 164, 67, 0.2);
}

/* Помилка (error) */
input[type="text"].is-invalid:focus,
input[type="email"].is-invalid:focus,
input[type="tel"].is-invalid:focus {
  outline: none;
  border-color: var(--main-color-red-2);
  box-shadow: 0 0 0 3px rgba(255, 77, 79, 0.2);
}

/* Placeholder */
input[type="text"]::placeholder,
input[type="email"]::placeholder,
input[type="tel"]::placeholder {
  color: var(--main-color-gray-6);
  opacity: 1; /* щоб колір завжди був однаковим */
}

/* Disabled */
input[type="text"]:disabled,
input[type="email"]:disabled,
input[type="tel"]:disabled {
  background: var(--main-color-gray-1);
  color: var(--main-color-gray-5);
  cursor: not-allowed;
}


/* Result */
.result {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 999px;
  background: var(--main-color-gray-2);
  border: 2px solid var(--main-color-gray-3);
  font-size: 16px;
  width: fit-content;
}

.level {
  font-weight: 800;
}

.level.ok {
  color: var(--main-color-green-2);
}

.level.warn {
  color: var(--main-color-orange-2);
}

.cta {
  width: -webkit-fill-available;
  margin-top: 24px;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  justify-content: center;
}

/* Media inside question */
.qmedia {
  margin: 8px 0 14px;
  display: grid;
  place-items: center;
}
.qmedia img {
  max-width: 100%;
  height: 200px;
  border-radius: 12px;
  object-fit: contain;
  color: var(--main-color-gray-7);
}
.qmedia .cap {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
}

/* Result media */
.rmedia {
  margin: 10px 0 12px;
  display: grid;
  place-items: center;
}
.rmedia img {
  max-width: 100%;
  max-height: 200px;
  border-radius: 12px;
  color: var(--main-color-gray-7);
  object-fit: contain;
}
.rmedia .cap {
  margin-top: 6px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* Простий fade між питаннями */
.qbox {
    transition: opacity .8s ease, height .8s ease;
}

.qbox.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Welcome screen */
.welcome {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.welcome .text {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.welcome h2 {
  font-size: 30px;
  line-height: 38px;
  color: var(--main-color-gray-9);
  font-weight: 550;
}

.welcome h3 {
  font-size: 20px;
  line-height: 28px;
  color: var(--main-color-gray-9);
  font-weight: 600;
}

.welcome .row {
  margin-top: 14px;
}

.welcome ul {
  padding-left: 24px;
  list-style-type: disc;
  color: var(--main-color-gray-8);
  line-height: 1.2;
}

.welcome li {
  margin-bottom: 4px;
  padding-left: 4px;
}

.test-thumb {
  width: 160px;
  height: 160px;
}

.hidden-el {
  display: none !important;
}

/* Декор для головного екрана */
.header {
  text-align: center;
  display: flex;
  align-items: center;
  margin-bottom: 24px;
  flex-direction: column;
}

.age-wrap {
  display: grid;
  gap: 12px;
  grid-template-columns: 1fr;
  margin-top: 14px;
}

.age-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--main-color-gray-2);
  border: 2px solid var(--main-color-gray-3);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  gap: 16px;
}

.age-card:hover {
  background: var(--main-color-gray-3);
}

.age-card .title {
  font-weight: 700;
  margin: 8px 0;
  color: var(--main-color-gray-9);
}

.age-card .desc {
  color: var(--main-color-gray-7);
  margin: 8px 0;
}

.age-card .go {
  background: var(--accent);
  color: var(--accent-ink);
  padding: 8px 12px;
  border-radius: 10px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .wrap {
    padding: 12px;
  }

  .card {
    padding: 16px;
  }

  .logo {
    display: none;
  }

  .buttons {
    flex-direction: column-reverse;
    align-items: center;
    margin: 0;
  }

  .test-thumb {
    width: 120px;
    height: 120px;
  }

  .welcome {
    gap: 16px;
  }

  .welcome .text {
    gap: 8px;
  }

  .welcome h2 {
    font-size: 18px;
    line-height: 27px;
  }

  .welcome h3 {
    font-size: 16px;
    line-height: 24px;
  }

  .welcome ul {
    font-size: 14px;    
  }

  p {
    font-size: 14px;
    line-height: 20px;
  }

  .age-card {
    align-items: center;
    flex-direction: column;
    text-align: center;
    gap: 8px;
  }

  .age-card .desc {
    margin: 0;
  }

  .age-card .title {
    font-size: 16px;
    line-height: 24px;
  }

  .header {
    margin-top: 16px;
    gap: 8px;
  }

  .opt {
    padding: 8px 12px;
  }

  .opt:hover {
    background: var(--main-color-gray-2);
  }

  .qmedia img {
    height: 140px;
  }

  .muted {
    text-align: center;
  }

  .grid {
    margin-bottom: 16px;
  }

}