:root {
  --bg: #f4f6f8;
  --bg-card: #ffffff;
  --ink: #0f172a;
  --ink-muted: #64748b;
  --border: #e2e8f0;
  --accent: #1e4d7b;
  --accent-hover: #163a5f;
  --accent-soft: rgba(30, 77, 123, 0.12);
  --star-empty: #cbd5e1;
  --star-fill: #1e4d7b;
  --shadow: 0 4px 24px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --radius: 16px;
  --font: "Plus Jakarta Sans", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

.bg-pattern {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(30, 77, 123, 0.07), transparent),
    radial-gradient(ellipse 60% 40% at 100% 50%, rgba(15, 23, 42, 0.03), transparent);
  z-index: 0;
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.5rem) 1.25rem 3rem;
}

.brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-logo {
  display: block;
  margin: 0 auto;
  max-width: min(100%, 280px);
  width: 100%;
  height: auto;
}

.brand-tag {
  margin: 0.75rem 0 0;
  font-size: 0.8125rem;
  color: var(--ink-muted);
  font-weight: 500;
}

.type-switch {
  display: flex;
  width: 100%;
  padding: 0.2rem;
  margin: 0 0 1.25rem;
  background: #eef2f6;
  border-radius: 12px;
  border: 1px solid var(--border);
  gap: 0.2rem;
}

.type-switch-btn {
  flex: 1 1 0;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-family: inherit;
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.6rem 0.5rem;
  border-radius: 9px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.type-switch-btn:hover {
  color: var(--ink);
}

.type-switch-btn.is-active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.field-chips-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.chip {
  margin: 0;
  padding: 0.5rem 0.75rem;
  max-width: 100%;
  font-family: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  color: var(--ink);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.chip:hover {
  border-color: #cbd5e1;
  background: #fff;
}

.chip:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.chip.is-selected {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-hover);
  font-weight: 600;
}

.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  padding: clamp(1.5rem, 4vw, 2rem);
}

.card-title {
  margin: 0 0 0.5rem;
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.card-lead {
  margin: 0 0 1.5rem;
  color: var(--ink-muted);
  font-size: 0.9375rem;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0.01em;
}

.optional {
  font-weight: 400;
  color: var(--ink-muted);
}

.field-hint {
  margin: 0;
  margin-top: 0.35rem;
  min-height: 1.25rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.35;
  text-align: center;
  color: var(--accent);
}

.field-hint.is-muted {
  color: var(--ink-muted);
  font-weight: 500;
}

.field-hint.is-error {
  color: #b91c1c;
  font-weight: 500;
  font-size: 0.8125rem;
}

.stars {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  width: 100%;
  align-items: center;
  justify-items: center;
  gap: 0;
  padding: 0.25rem 0;
  touch-action: manipulation;
}

.star-btn {
  appearance: none;
  border: none;
  padding: 0.35rem 0.2rem;
  margin: 0;
  width: 100%;
  min-height: 2.75rem;
  background: transparent;
  cursor: pointer;
  color: var(--star-empty);
  border-radius: 8px;
  transition: color 0.06s ease, background 0.06s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.star-btn:hover,
.star-btn:focus-visible {
  color: var(--star-fill);
  background: var(--accent-soft);
}

.star-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.star-btn:active {
  opacity: 0.85;
}

.star-btn[data-active="true"] {
  color: var(--star-fill);
}

.star-btn svg {
  display: block;
  width: 36px;
  height: 36px;
  pointer-events: none;
}

.star-btn .star-shape {
  stroke: currentColor;
  stroke-width: 1.2;
  stroke-linejoin: round;
  fill: none;
}

.star-btn[data-active="true"] .star-shape {
  fill: currentColor;
}

@media (max-width: 380px) {
  .star-btn svg {
    width: 32px;
    height: 32px;
  }
}

textarea {
  width: 100%;
  margin: 0;
  padding: 0.875rem 1rem;
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink);
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 12px;
  resize: vertical;
  min-height: 112px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

textarea::placeholder {
  color: #94a3b8;
}

textarea:hover {
  border-color: #cbd5e1;
}

textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  background: #fff;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  border-radius: 12px;
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.12s ease, opacity 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  margin-top: 0.25rem;
}

.btn-primary:hover:not(:disabled) {
  background: var(--accent-hover);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(1px);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-spinner {
  width: 1.125rem;
  height: 1.125rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.card-success {
  text-align: center;
  padding: 2rem 1.5rem;
}

.success-icon {
  color: var(--accent);
  margin-bottom: 1rem;
}

.card-success .card-title {
  margin-bottom: 0.5rem;
}

.card-success .card-lead {
  margin-bottom: 0;
}
