:root {
  --navy-950: #07101d;
  --navy-900: #0b1728;
  --navy-800: #102239;
  --navy-700: #17304e;
  --red-600: #d91f2c;
  --red-500: #ef3340;
  --white: #ffffff;
  --muted: #a9b4c3;
  --line: rgba(255, 255, 255, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--navy-950);
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(32, 64, 98, 0.28), transparent 35%),
    linear-gradient(145deg, #07101d 0%, #0a1524 52%, #060c15 100%);
  color: var(--white);
  font-family: Arial, "Helvetica Neue", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-shell {
  position: relative;
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  overflow: hidden;
  padding: 44px clamp(20px, 5vw, 72px) 24px;
}

.ambient {
  position: absolute;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(1px);
}

.ambient-one {
  top: -260px;
  right: -180px;
  width: 560px;
  height: 560px;
  border: 1px solid rgba(239, 51, 64, 0.16);
  box-shadow:
    0 0 0 80px rgba(239, 51, 64, 0.025),
    0 0 0 160px rgba(239, 51, 64, 0.018);
}

.ambient-two {
  bottom: -330px;
  left: -270px;
  width: 600px;
  height: 600px;
  background: rgba(32, 65, 102, 0.12);
}

.generator {
  position: relative;
  z-index: 1;
  width: min(1120px, 100%);
  margin: auto;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.brand-mark {
  display: grid;
  width: 50px;
  height: 50px;
  place-items: center;
  border: 1px solid rgba(239, 51, 64, 0.7);
  border-radius: 14px;
  background: linear-gradient(145deg, #e32230, #a70d1a);
  box-shadow: 0 12px 28px rgba(210, 24, 38, 0.26);
  color: white;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.eyebrow,
.section-kicker {
  margin: 0;
  color: var(--red-500);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.19em;
  text-transform: uppercase;
}

.brand-header h1 {
  margin: 4px 0 0;
  font-size: clamp(25px, 3vw, 34px);
  letter-spacing: -0.03em;
}

.generator-grid {
  display: grid;
  grid-template-columns: minmax(310px, 0.92fr) minmax(440px, 1.22fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(10, 22, 38, 0.78);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.36);
  backdrop-filter: blur(18px);
}

.control-card {
  position: relative;
  padding: clamp(28px, 4vw, 48px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.055), transparent 48%),
    rgba(8, 19, 33, 0.7);
}

.section-number {
  position: absolute;
  top: 26px;
  right: 28px;
  color: rgba(255, 255, 255, 0.07);
  font-size: 72px;
  font-weight: 900;
  line-height: 1;
}

.control-card h2,
.preview-heading h2 {
  position: relative;
  margin: 9px 0 0;
  letter-spacing: -0.025em;
}

.control-card h2 {
  max-width: 370px;
  font-size: clamp(27px, 3.1vw, 39px);
  line-height: 1.08;
}

.control-card form {
  margin-top: 28px;
}

form label {
  display: block;
  margin-bottom: 9px;
  color: #dce4ee;
  font-size: 13px;
  font-weight: 700;
}

.area-picker {
  min-width: 0;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}

.area-picker legend {
  margin-bottom: 9px;
  padding: 0;
  color: #dce4ee;
  font-size: 13px;
  font-weight: 700;
}

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

form .area-option {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(4, 11, 20, 0.62);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.area-option:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(9, 21, 36, 0.9);
  transform: translateY(-1px);
}

.area-option.is-selected {
  border-color: rgba(239, 51, 64, 0.85);
  background: rgba(173, 19, 32, 0.15);
  box-shadow: 0 0 0 3px rgba(239, 51, 64, 0.08);
}

.area-option:focus-within {
  outline: 3px solid rgba(239, 51, 64, 0.35);
  outline-offset: 2px;
}

.area-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.area-code {
  display: grid;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(239, 51, 64, 0.42);
  border-radius: 9px;
  background: rgba(209, 30, 43, 0.15);
  color: #ff6570;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.area-label {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 2px;
}

.area-label strong {
  overflow: hidden;
  color: #f4f7fb;
  font-size: 12px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.input-wrap {
  position: relative;
}

.input-wrap input {
  width: 100%;
  height: 56px;
  padding: 0 66px 0 17px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 13px;
  outline: none;
  background: rgba(4, 11, 20, 0.72);
  color: white;
  font-size: 15px;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    background 160ms ease;
}

.input-wrap input::placeholder {
  color: #718095;
}

.input-wrap input:focus {
  border-color: var(--red-500);
  background: rgba(5, 13, 23, 0.92);
  box-shadow: 0 0 0 4px rgba(239, 51, 64, 0.13);
}

.input-wrap span {
  position: absolute;
  top: 50%;
  right: 15px;
  color: #728096;
  font-size: 11px;
  transform: translateY(-50%);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 15px;
}

.primary-button,
.secondary-button {
  min-height: 43px;
  padding: 0 16px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 700;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-width: 185px;
  border: 1px solid #f04450;
  background: linear-gradient(145deg, #ec2c39, #bd1421);
  box-shadow: 0 12px 25px rgba(204, 22, 36, 0.25);
  color: white;
}

.primary-button span {
  font-size: 17px;
  line-height: 1;
}

.primary-button:hover:not(:disabled) {
  background: linear-gradient(145deg, #f23945, #c71825);
  box-shadow: 0 15px 30px rgba(204, 22, 36, 0.32);
  transform: translateY(-1px);
}

.primary-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.04);
  color: #dbe3ed;
}

.secondary-button:hover {
  border-color: rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.075);
  transform: translateY(-1px);
}

.primary-button:focus-visible,
.secondary-button:focus-visible {
  outline: 3px solid rgba(239, 51, 64, 0.4);
  outline-offset: 2px;
}

.download-status {
  min-height: 18px;
  margin: 8px 0 0;
  color: #79dca4;
  font-size: 11px;
}

.format-note {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 30px;
  color: #8f9caf;
  font-size: 12px;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #49cf85;
  box-shadow: 0 0 0 5px rgba(73, 207, 133, 0.09);
}

.preview-column {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 4.8vw, 58px);
  background:
    linear-gradient(145deg, rgba(21, 46, 75, 0.4), rgba(6, 14, 24, 0.12)),
    rgba(9, 19, 32, 0.48);
}

.preview-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  width: min(100%, 540px);
  margin: 0 auto 20px;
}

.preview-heading h2 {
  font-size: 22px;
}

.size-badge {
  flex: 0 0 auto;
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 9px;
  color: #9cabbc;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.canvas-frame {
  position: relative;
  width: min(100%, 540px);
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 15px;
  background: #03070c;
  box-shadow:
    0 26px 52px rgba(0, 0, 0, 0.4),
    0 0 0 8px rgba(255, 255, 255, 0.025);
}

.canvas-frame canvas {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 11 / 7;
}

.canvas-loader {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: #08121f;
  color: #98a6b8;
  font-size: 13px;
}

.preview-hint {
  width: min(100%, 540px);
  margin: 17px auto 0;
  color: #77869a;
  font-size: 12px;
  text-align: center;
}

footer {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 9px;
  padding-top: 25px;
  color: #617086;
  font-size: 11px;
  letter-spacing: 0.05em;
}

@media (max-width: 900px) {
  .site-shell {
    padding-top: 28px;
  }

  .generator-grid {
    grid-template-columns: 1fr;
  }

  .control-card {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .preview-column {
    min-height: 480px;
  }
}

@media (max-width: 520px) {
  .site-shell {
    padding-right: 14px;
    padding-left: 14px;
  }

  .brand-header {
    margin-left: 4px;
  }

  .brand-mark {
    width: 44px;
    height: 44px;
  }

  .generator-grid {
    border-radius: 20px;
  }

  .control-card,
  .preview-column {
    padding: 26px 20px;
  }

  .primary-button,
  .secondary-button {
    flex: 1 1 auto;
  }

  .area-options {
    grid-template-columns: 1fr;
  }

  .section-number {
    right: 18px;
    font-size: 58px;
  }

  .preview-column {
    min-height: 370px;
  }

  .preview-heading {
    align-items: flex-start;
  }

  .size-badge {
    display: none;
  }

  footer {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
