:root {
  --navy: #002d62;
  --navy-deep: #001a3a;
  --ink: #0b1b33;
  --muted: #5a6d86;
  --line: rgba(0, 45, 98, 0.12);
  --surface: rgba(255, 255, 255, 0.78);
  --accent: #0a4a9e;
  --accent-soft: #e8f0fa;
  --danger: #c0392b;
  --ok: #0f7a4a;
  --radius: 18px;
  --font: "Manrope", system-ui, sans-serif;
  --display: "Sora", "Manrope", sans-serif;
}

* {
  box-sizing: border-box;
}

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

body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(900px 520px at 8% -5%, #c5d8f0 0%, transparent 55%),
    radial-gradient(700px 480px at 100% 0%, #dce7f5 0%, transparent 50%),
    linear-gradient(180deg, #f4f7fb 0%, #e8eef6 45%, #f7f9fc 100%);
  overflow-x: hidden;
}

.glow {
  pointer-events: none;
  position: fixed;
  inset: auto -10% -20% auto;
  width: min(520px, 70vw);
  height: min(520px, 70vw);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 45, 98, 0.12), transparent 70%);
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2rem));
  margin: 0 auto;
  padding: clamp(2.8rem, 10vh, 5.5rem) 0 3rem;
  animation: rise 0.65s ease both;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.brand {
  text-align: left;
}

.brand-logo {
  display: block;
  width: min(260px, 72vw);
  height: auto;
  margin: 0 0 1.35rem;
  animation: rise 0.7s ease both;
}

.brand h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.75rem, 5vw, 2.45rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  color: var(--navy);
  max-width: 14ch;
}

.lede {
  margin: 0.85rem 0 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.5;
  max-width: 36ch;
}

.panel {
  margin-top: 2.1rem;
  padding: 1.35rem;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 29, 70, 0.08);
  backdrop-filter: blur(12px);
  animation: rise 0.75s 0.06s ease both;
}

.field {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 1.15rem;
}

.field > span {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

input[type="url"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
  padding: 0.95rem 1rem;
  font: inherit;
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="url"]:focus {
  border-color: rgba(0, 45, 98, 0.45);
  box-shadow: 0 0 0 4px rgba(0, 45, 98, 0.08);
}

.formats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.55rem;
}

.format {
  appearance: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  color: var(--ink);
  padding: 0.85rem 0.75rem;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s, background 0.18s, transform 0.18s;
}

.format:hover {
  border-color: rgba(0, 45, 98, 0.28);
  transform: translateY(-1px);
}

.format[aria-checked="true"] {
  border-color: var(--navy);
  background: var(--accent-soft);
  color: var(--navy);
}

.actions {
  display: flex;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

button {
  font: inherit;
  border: 0;
  cursor: pointer;
  border-radius: 14px;
  padding: 0.9rem 1.3rem;
  font-weight: 700;
  transition: transform 0.15s, opacity 0.15s, background 0.15s;
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

button:not(:disabled):active {
  transform: scale(0.98);
}

.primary {
  background: var(--navy);
  color: #fff;
}

.primary:not(:disabled):hover {
  background: var(--navy-deep);
}

.ghost {
  background: transparent;
  color: var(--navy);
  border: 1px solid var(--line);
}

.ghost:not(:disabled):hover {
  background: rgba(0, 45, 98, 0.04);
}

.status {
  margin-top: 1rem;
  padding: 0.85rem 1rem;
  border-radius: 14px;
  font-size: 0.95rem;
  line-height: 1.4;
}

.status.info {
  background: var(--accent-soft);
  color: var(--muted);
}

.status.error {
  background: rgba(192, 57, 43, 0.1);
  color: var(--danger);
}

.status.ok {
  background: rgba(15, 122, 74, 0.1);
  color: var(--ok);
}

.status a {
  color: inherit;
  font-weight: 800;
}

.preview {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  align-items: center;
  animation: rise 0.45s ease both;
}

.preview img {
  width: 120px;
  height: 68px;
  object-fit: cover;
  border-radius: 10px;
  background: #d9e3f0;
}

.preview h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--navy);
}

.preview p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.foot {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

@media (max-width: 560px) {
  .preview {
    grid-template-columns: 1fr;
  }

  .preview img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }

  .actions {
    flex-direction: column;
  }

  .actions button {
    width: 100%;
  }
}
