:root {
  color-scheme: light;
  font-family: "Trebuchet MS", "Avenir Next", system-ui, sans-serif;
  color: #173d33;
  background: #f7f1e8;
  font-synthesis: none;
  --green: #1c6b55;
  --green-dark: #12483a;
  --cream: #fffaf1;
  --orange: #ef8e45;
  --red: #b9433b;
  --shadow: 0 18px 45px rgb(20 65 51 / 14%);
}

* { box-sizing: border-box; }

html, body, #app { width: 100%; min-height: 100%; margin: 0; }

body {
  min-height: 100dvh;
  overflow: hidden;
  overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
  background:
    radial-gradient(circle at 12% 15%, rgb(239 142 69 / 18%), transparent 24rem),
    radial-gradient(circle at 88% 82%, rgb(28 107 85 / 16%), transparent 28rem),
    #f7f1e8;
}

button { font: inherit; }

.screen {
  min-height: 100dvh;
  width: 100%;
  padding: max(28px, env(safe-area-inset-top)) max(28px, env(safe-area-inset-right))
    max(28px, env(safe-area-inset-bottom)) max(28px, env(safe-area-inset-left));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.brand {
  position: absolute;
  top: max(24px, env(safe-area-inset-top));
  left: max(28px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: .06em;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 24px;
}

.content { width: min(100%, 960px); }

.eyebrow {
  margin: 0 0 14px;
  color: var(--orange);
  font-size: clamp(15px, 2vw, 20px);
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 82px);
  line-height: .98;
  letter-spacing: -.045em;
}

.subtitle {
  max-width: 720px;
  margin: 24px auto 0;
  font-size: clamp(20px, 3vw, 30px);
  line-height: 1.35;
  color: #47685f;
}

.primary, .secondary, .cancel-payment, .test-button, .product-card {
  min-height: 72px;
  border: 0;
  border-radius: 22px;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform .12s ease, box-shadow .12s ease;
}

button:active { transform: scale(.98); }
button:focus-visible { outline: 5px solid rgb(239 142 69 / 40%); outline-offset: 4px; }
button:disabled { opacity: .55; cursor: wait; }

.primary {
  min-width: min(100%, 340px);
  margin-top: 38px;
  padding: 18px 34px;
  color: white;
  background: var(--green);
  box-shadow: 0 12px 24px rgb(28 107 85 / 26%);
  font-size: 24px;
  font-weight: 900;
}

.secondary {
  min-width: 220px;
  padding: 16px 28px;
  color: var(--green);
  background: transparent;
  border: 3px solid rgb(28 107 85 / 24%);
  font-size: 21px;
  font-weight: 800;
}

.cancel-payment {
  min-width: min(100%, 260px);
  margin-top: 28px;
  padding: 16px 28px;
  color: var(--red);
  background: rgb(255 250 241 / 84%);
  border: 3px solid rgb(185 67 59 / 24%);
  box-shadow: 0 10px 22px rgb(185 67 59 / 10%);
  font-size: 22px;
  font-weight: 900;
}

.actions {
  margin-top: 34px;
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

.products {
  margin-top: 34px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 22px;
}

.product-card {
  padding: 30px;
  color: inherit;
  background: rgb(255 250 241 / 90%);
  border: 3px solid transparent;
  box-shadow: var(--shadow);
  text-align: left;
}

.product-card:hover, .product-card:focus-visible { border-color: var(--orange); }
.product-name { display: block; font-size: 30px; font-weight: 900; }
.product-volume { display: block; margin-top: 8px; color: #678079; font-size: 20px; }
.product-price { display: block; margin-top: 28px; color: var(--green); font-size: 42px; font-weight: 900; }

.summary {
  width: min(100%, 640px);
  margin: 32px auto 0;
  padding: 30px;
  border-radius: 26px;
  background: var(--cream);
  box-shadow: var(--shadow);
}

.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 20px; font-size: 24px; }
.summary-row + .summary-row { margin-top: 22px; padding-top: 22px; border-top: 2px solid #e9dfd0; }
.summary strong { font-size: 30px; }

.icon {
  width: clamp(116px, 18vw, 176px);
  height: clamp(116px, 18vw, 176px);
  margin: 0 auto 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  box-shadow: 0 18px 40px rgb(28 107 85 / 22%);
  font-size: clamp(54px, 9vw, 86px);
}

.icon.error { background: var(--red); }
.icon.warn { background: var(--orange); }
.spinner { animation: pulse 1.35s ease-in-out infinite; }

.progress {
  width: min(90%, 540px);
  height: 16px;
  margin: 34px auto 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgb(28 107 85 / 14%);
}
.progress::after {
  content: "";
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: var(--orange);
  animation: loading 1.4s ease-in-out infinite;
}

.release-ring {
  --progress: 360deg;
  width: clamp(160px, 24vw, 220px);
  height: clamp(160px, 24vw, 220px);
  margin: 34px auto 0;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--orange) var(--progress), rgb(28 107 85 / 14%) 0);
  box-shadow: var(--shadow);
}

.release-countdown {
  width: calc(100% - 28px);
  height: calc(100% - 28px);
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--green-dark);
  background: var(--cream);
  border: 6px solid rgb(255 255 255 / 70%);
  font-size: clamp(38px, 6vw, 56px);
  font-weight: 900;
}

.test-panel {
  width: min(100%, 760px);
  margin: 34px auto 0;
  padding: 20px;
  border: 3px dashed rgb(239 142 69 / 52%);
  border-radius: 24px;
  background: rgb(255 250 241 / 72%);
}

.test-label { margin: 0 0 14px; color: #8d552d; font-weight: 900; text-transform: uppercase; letter-spacing: .09em; }
.test-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.test-button { min-height: 58px; padding: 10px 14px; color: var(--green-dark); background: white; border: 2px solid #e9dfd0; font-weight: 800; }
.test-button.danger { color: var(--red); }
.error-message { margin-top: 22px; color: var(--red); font-size: 19px; font-weight: 800; }
.hidden { display: none !important; }

.clip-guide {
  width: min(100%, 920px);
  margin: 34px auto 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.guide-step {
  min-height: 260px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 3px solid rgb(28 107 85 / 18%);
  border-radius: 22px;
  background: rgb(255 250 241 / 92%);
  box-shadow: var(--shadow);
}

.step-number {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 24px;
  font-weight: 900;
}

.guide-step strong {
  min-height: 58px;
  display: flex;
  align-items: center;
  color: var(--green-dark);
  font-size: clamp(21px, 2.2vw, 28px);
  line-height: 1.08;
}

.terminal-button {
  width: 84px;
  height: 84px;
  border-radius: 24px;
  border: 7px solid white;
  box-shadow: inset 0 0 0 7px rgb(255 255 255 / 42%), 0 12px 24px rgb(18 72 58 / 16%);
}

.green-button {
  background: radial-gradient(circle, #e7fff4 0 28%, #62be78 30% 48%, #34924f 50% 100%);
}

.terminal-screen {
  width: min(100%, 210px);
  height: 114px;
  padding: 18px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-radius: 18px;
  background: linear-gradient(#eaf8ff, #dff0fb);
  box-shadow: inset 0 0 0 3px rgb(23 61 51 / 10%);
}

.terminal-screen span {
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  color: #47685f;
  background: white;
  font-size: 15px;
  font-weight: 900;
}

.terminal-screen span:first-child {
  color: var(--green-dark);
  background: transparent;
}

.terminal-screen span:last-child {
  color: white;
  background: var(--orange);
}

.clip-ready {
  width: 136px;
  height: 96px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  color: white;
  background: #f06423;
  transform: rotate(-3deg);
  font-size: 44px;
  font-weight: 900;
  letter-spacing: 0;
}

.retry-note {
  margin: 26px auto 0;
  color: #47685f;
  font-size: clamp(20px, 2.4vw, 28px);
  font-weight: 900;
}

.retry-note::after {
  content: "";
  display: inline-block;
  width: 1.4em;
  text-align: left;
  animation: dots 1.2s steps(4, end) infinite;
}

@keyframes pulse { 50% { transform: scale(.94); opacity: .72; } }
@keyframes loading { 0% { transform: translateX(-110%); } 100% { transform: translateX(350%); } }
@keyframes dots {
  0% { content: ""; }
  25% { content: "."; }
  50% { content: ".."; }
  75%, 100% { content: "..."; }
}

@media (max-width: 640px), (max-height: 650px) {
  .screen { padding: 20px; }
  .brand { top: 16px; left: 18px; }
  .brand-mark { width: 36px; height: 36px; font-size: 19px; }
  .content { padding-top: 48px; }
  .products { margin-top: 24px; grid-template-columns: 1fr 1fr; }
  .product-card { padding: 20px; }
  .product-name { font-size: 23px; }
  .product-price { margin-top: 16px; font-size: 34px; }
  .test-grid { grid-template-columns: repeat(2, 1fr); }
  .clip-guide { grid-template-columns: 1fr; gap: 12px; }
  .guide-step {
    min-height: 0;
    padding: 16px;
    display: grid;
    grid-template-columns: 44px 96px 1fr;
    text-align: left;
  }
  .step-number { width: 40px; height: 40px; font-size: 20px; }
  .guide-step strong { min-height: 0; font-size: 20px; }
  .terminal-button { width: 62px; height: 62px; border-radius: 18px; border-width: 5px; }
  .terminal-screen { width: 96px; height: 62px; padding: 8px; gap: 4px; }
  .terminal-screen span { padding: 5px; font-size: 8px; border-radius: 7px; }
  .clip-ready { width: 86px; height: 58px; font-size: 28px; border-radius: 12px; }
}
