:root {
  --bg: #080e0b;
  --surface: #0f1a14;
  --surface-hover: #162019;
  --border: #1f3329;
  --accent-1: #10b981;
  --accent-2: #6ee7b7;
  --white: #ffffff;
  --gradient: linear-gradient(135deg, #10b981, #6ee7b7);
  --text: #f0fdf4;
  --text-muted: #86efac;
  --text-soft: #64748b;
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #10b981;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 18% 0%, rgba(16, 185, 129, 0.14), transparent 28rem),
    radial-gradient(circle at 88% 18%, rgba(110, 231, 183, 0.11), transparent 25rem),
    linear-gradient(180deg, #080e0b 0%, #0b1410 56%, #07100c 100%);
}

button,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

.site-header {
  border-bottom: 1px solid transparent;
  border-image: var(--gradient) 1;
  background: rgba(8, 14, 11, 0.82);
  backdrop-filter: blur(16px);
}

.header-inner {
  width: min(1120px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  text-decoration: none;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.brand-icon {
  font-size: 26px;
}

.ai-badge,
.result-badge {
  display: inline-flex;
  align-items: center;
  width: max-content;
  min-height: 28px;
  padding: 6px 12px;
  color: var(--white);
  background: var(--gradient);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.page-shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 48px;
}

.hero {
  max-width: 760px;
  margin-bottom: 44px;
}

.hero h1 {
  margin: 0;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: clamp(40px, 7vw, 48px);
  line-height: 1.02;
  letter-spacing: 0;
}

.hero h1 span {
  color: transparent;
  background: var(--gradient);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero p {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 18px;
  line-height: 1.65;
}

.generator {
  margin-bottom: 32px;
}

.generator h2 {
  margin: 0 0 18px;
  font-family: "Space Grotesk", Inter, sans-serif;
  font-size: 20px;
  letter-spacing: 0;
}

.situation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.situation-card {
  min-height: 112px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 12px;
  color: var(--text);
  background: var(--surface);
  border: 2px solid transparent;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  text-align: left;
  transition: background-color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.situation-card:hover {
  background: var(--surface-hover);
  transform: translateY(-1px);
}

.situation-card[aria-checked="true"] {
  border-color: var(--accent-1);
  box-shadow: 0 0 16px rgba(16, 185, 129, 0.25), 0 18px 50px rgba(0, 0, 0, 0.24);
}

.situation-card span {
  font-size: 28px;
  line-height: 1;
}

.situation-card strong {
  font-size: 16px;
  line-height: 1.3;
}

.custom-label {
  display: block;
  margin: 22px 0 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

textarea {
  width: 100%;
  min-height: 124px;
  resize: vertical;
  padding: 16px;
  color: var(--text);
  background: rgba(15, 26, 20, 0.94);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  line-height: 1.5;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background-color 0.18s ease;
}

textarea::placeholder {
  color: #4a7a5e;
}

textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(110, 231, 183, 0.12);
  background: var(--surface);
}

.error-message {
  min-height: 24px;
  margin: 12px 0 0;
  color: var(--danger);
  font-size: 14px;
  font-weight: 700;
}

.generate-button,
.copy-button,
.variant-button {
  min-height: 56px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, border-color 0.18s ease;
}

.generate-button {
  width: 100%;
  max-width: 360px;
  margin-top: 4px;
  padding: 16px 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--white);
  background: var(--gradient);
  font-size: 18px;
  box-shadow: 0 14px 48px rgba(16, 185, 129, 0.18);
}

.generate-button:hover:not(:disabled),
.copy-button:hover:not(:disabled) {
  box-shadow: 0 0 28px rgba(16, 185, 129, 0.4);
  transform: translateY(-1px);
}

.generate-button:disabled {
  cursor: wait;
  opacity: 0.78;
}

.button-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.36);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.75s linear infinite;
}

.generate-button.is-loading .button-spinner {
  display: inline-block;
}

.result-card {
  padding: 32px;
  background: rgba(15, 26, 20, 0.96);
  border: 1px solid var(--accent-1);
  border-radius: 16px;
  box-shadow: var(--shadow);
  animation: resultIn 0.4s ease both;
}

.excuse-text {
  min-height: 108px;
  margin: 22px 0 26px;
  color: var(--white);
  font-size: 18px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.rating-block {
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.rating-title {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 700;
}

.rating-value {
  margin-bottom: 12px;
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.rating-value.is-success {
  color: var(--success);
}

.rating-value.is-warning {
  color: var(--warning);
}

.rating-value.is-danger {
  color: var(--danger);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  background: var(--border);
  border-radius: 999px;
}

.progress-fill {
  width: 0;
  height: 100%;
  background: var(--gradient);
  border-radius: inherit;
  transition: width 0.8s ease;
}

.verdict {
  margin: 10px 0 0;
  color: var(--text-muted);
  font-size: 14px;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  margin-top: 24px;
}

.copy-button {
  padding: 14px 18px;
  color: var(--white);
  background: var(--gradient);
}

.variant-button {
  padding: 12px 18px;
  color: var(--accent-2);
  background: transparent;
  border: 2px solid var(--accent-2);
}

.variant-button:hover:not(:disabled) {
  border-color: #a7f3d0;
  box-shadow: 0 0 18px rgba(110, 231, 183, 0.28);
  transform: translateY(-1px);
}

.site-footer {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 32px;
  color: var(--text-muted);
  text-align: center;
  font-size: 14px;
}

.site-footer p {
  margin: 6px 0;
}

.site-footer p + p {
  color: var(--text-soft);
  font-size: 12px;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes resultIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 760px) {
  .page-shell {
    padding-top: 46px;
  }

  .header-inner {
    width: min(100% - 24px, 1120px);
    min-height: 68px;
  }

  .brand {
    font-size: 21px;
  }

  .hero {
    margin-bottom: 34px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p {
    font-size: 16px;
  }

  .situation-grid,
  .result-actions {
    grid-template-columns: 1fr;
  }

  .situation-card {
    min-height: 82px;
    flex-direction: row;
    align-items: center;
  }

  .generate-button {
    max-width: none;
  }

  .result-card {
    padding: 24px;
  }
}

@media (max-width: 420px) {
  .header-inner,
  .page-shell,
  .site-footer {
    width: min(100% - 24px, 980px);
  }

  .ai-badge {
    padding-inline: 10px;
  }

  .hero h1 {
    font-size: 36px;
  }

  .copy-button,
  .variant-button {
    min-height: 52px;
  }
}
