:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #07131f;
  --muted: #718097;
  --line: #e4eaf2;
  --dark: #172235;
  --accent: #16b981;
  --accent-dark: #0c8a63;
  --blue: #18a7e0;
  --orange: #ff7a1a;
  --danger: #e23d55;
  --shadow: 0 22px 60px rgba(23, 34, 53, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    linear-gradient(180deg, rgba(244, 247, 251, 0.96), rgba(244, 247, 251, 1)),
    repeating-linear-gradient(90deg, rgba(23, 34, 53, 0.035) 0 1px, transparent 1px 72px);
  color: var(--text);
}

.app {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 28px 0 46px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  min-height: 188px;
  overflow: hidden;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(135deg, #ffffff 0%, #f8fbff 48%, #eef7f4 100%);
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, transparent, rgba(22, 185, 129, 0.12), transparent),
    linear-gradient(180deg, transparent 0%, rgba(24, 167, 224, 0.08) 100%);
  transform: translateX(-55%);
  animation: shine 5.5s ease-in-out infinite;
}

.hero-mark,
.hero-copy,
.hero-pulse {
  position: relative;
  z-index: 1;
}

.hero-mark {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 24px;
  background: var(--dark);
  color: #fff;
  font-weight: 950;
  box-shadow: 0 16px 32px rgba(23, 34, 53, 0.2);
}

.hero-copy {
  text-align: center;
}

.eyebrow,
.label {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  letter-spacing: 0;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: clamp(3rem, 8vw, 6.4rem);
  line-height: 0.86;
  color: var(--dark);
}

.hero-text {
  max-width: 560px;
  margin: 16px auto 0;
  color: #536276;
  font-size: 1.02rem;
  font-weight: 650;
  line-height: 1.55;
}

.hero-pulse {
  width: 88px;
  height: 88px;
  border-radius: 28px;
  background:
    linear-gradient(135deg, var(--accent), #32d7a0);
  box-shadow: 0 18px 40px rgba(22, 185, 129, 0.24);
  animation: floatCard 3.6s ease-in-out infinite;
}

.hero-pulse::before,
.hero-pulse::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.hero-pulse::before {
  width: 46px;
  height: 10px;
  top: 26px;
  left: 21px;
}

.hero-pulse::after {
  width: 28px;
  height: 10px;
  top: 48px;
  left: 30px;
}

.tool {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--panel);
  box-shadow: 0 16px 44px rgba(23, 34, 53, 0.08);
}

.form label {
  display: block;
  margin-bottom: 10px;
  font-weight: 900;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 10px;
}

input,
button,
.secondary-action {
  min-height: 56px;
  border-radius: 18px;
  font: inherit;
}

input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0 18px;
  background: var(--panel-soft);
  color: var(--text);
  font-weight: 650;
  outline: none;
}

input:focus {
  border-color: rgba(22, 185, 129, 0.7);
  box-shadow: 0 0 0 5px rgba(22, 185, 129, 0.14);
}

button,
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  padding: 0 18px;
  font-weight: 950;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button {
  background: var(--dark);
  color: #fff;
  box-shadow: 0 14px 28px rgba(23, 34, 53, 0.16);
}

.primary-action {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 16px 30px rgba(22, 185, 129, 0.22);
}

.secondary-action {
  border: 1px solid #ffe1cc;
  background: #fff4ec;
  color: #a24608;
}

button:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

button:hover,
.primary-action:hover {
  background: var(--accent-dark);
}

button:disabled {
  cursor: progress;
  opacity: 0.62;
  transform: none;
}

.status {
  min-height: 28px;
  margin: 15px 4px 0;
  color: var(--muted);
  font-weight: 800;
}

.status.error {
  color: var(--danger);
}

.result {
  display: grid;
  grid-template-columns: minmax(280px, 420px) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin-top: 14px;
}

.preview-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(135deg, #eef4f8, #ffffff);
  aspect-ratio: 1 / 1;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.8);
}

.preview-wrap img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  padding: 10px;
}

.actions {
  display: grid;
  align-content: center;
  gap: 18px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    linear-gradient(180deg, #ffffff, #fbfcfe);
}

.actions h2 {
  overflow-wrap: anywhere;
  font-size: clamp(1.35rem, 3vw, 2.2rem);
  line-height: 1.08;
}

.count {
  margin: 10px 0 0;
  color: var(--muted);
  font-weight: 800;
}

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

@keyframes shine {
  0%, 42% {
    transform: translateX(-60%);
  }
  72%, 100% {
    transform: translateX(60%);
  }
}

@keyframes floatCard {
  0%, 100% {
    transform: translateY(0) rotate(0deg);
  }
  50% {
    transform: translateY(-8px) rotate(2deg);
  }
}

@media (max-width: 760px) {
  .app {
    width: min(100% - 18px, 680px);
    padding-top: 10px;
  }

  .hero {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: auto;
    padding: 28px 18px;
    border-radius: 28px;
  }

  .hero-mark,
  .hero-pulse {
    width: 58px;
    height: 58px;
    border-radius: 18px;
  }

  .hero-pulse::before {
    width: 32px;
    top: 18px;
    left: 13px;
  }

  .hero-pulse::after {
    width: 22px;
    top: 34px;
    left: 18px;
  }

  h1 {
    font-size: clamp(3rem, 16vw, 5.5rem);
  }

  .tool {
    padding: 13px;
    border-radius: 26px;
  }

  .input-row,
  .result,
  .button-grid {
    grid-template-columns: 1fr;
  }

  button,
  .secondary-action {
    width: 100%;
  }

  .actions {
    padding: 16px;
  }
}
