:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #0f1419;
  --muted: #5a6473;
  --primary: #1f6fef;
  --primary-hover: #1858c2;
  --accent: #ff6b35;
  --border: #e6e8ec;
  --error: #c1272d;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 18px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Roboto, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 24px; }

/* Topbar */
.topbar { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.topbar__inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.topbar__nav { display: flex; gap: 18px; align-items: center; }
.topbar__nav a { color: var(--muted); }

.balance { color: var(--muted); }
.balance strong { color: var(--text); font-weight: 600; }
.user-email { color: var(--muted); font-size: 14px; }

/* Hero */
.hero { padding: 80px 0 60px; }
.hero__title { font-size: 48px; line-height: 1.15; margin: 0 0 18px; font-weight: 700; }
.hero__subtitle { font-size: 18px; color: var(--muted); max-width: 700px; margin: 0 0 40px; }
.hero__form { max-width: 720px; }
.hero__form h3 { margin: 0 0 6px; font-size: 20px; }

/* Cards / grid */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); margin-bottom: 24px; }
.card--featured { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 111, 239, 0.08), var(--shadow); }
.grid { display: grid; gap: 20px; }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 800px) { .grid--3 { grid-template-columns: 1fr; } }

.features, .pricing { padding: 60px 0; }
.features h2, .pricing h2 { font-size: 32px; margin: 0 0 32px; }
.price { font-size: 24px; font-weight: 600; margin: 6px 0 12px; }
.card ul { padding-left: 20px; margin: 0; color: var(--muted); }
.card ul li { margin-bottom: 6px; }

/* Forms */
.row { display: flex; gap: 12px; margin-bottom: 12px; }
.row > * { flex: 1; }
@media (max-width: 600px) { .row { flex-direction: column; } }

.input {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
}
.input:focus { outline: 2px solid var(--primary); outline-offset: -1px; border-color: var(--primary); }
.input.code { font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace; font-size: 13px; }
textarea.input { resize: vertical; min-height: 80px; }

.field { display: block; margin-bottom: 16px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; font-weight: 500; }
.field--check { display: flex; gap: 8px; align-items: center; margin: 16px 0; cursor: pointer; }

.btn {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.btn--primary { background: var(--primary); color: white; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn--ghost:hover { background: var(--bg); }

.actions { display: flex; gap: 12px; margin-top: 16px; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }
.hint--muted { color: #999; }
.error { color: var(--error); margin-top: 12px; font-size: 14px; }

/* Modal */
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(15, 20, 25, 0.55); }
.modal__content { position: relative; max-width: 420px; width: calc(100% - 32px); margin: 0 16px; }
.modal__close { position: absolute; top: 12px; right: 12px; background: none; border: none; font-size: 28px; line-height: 1; cursor: pointer; color: var(--muted); }
.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tab { background: none; border: none; padding: 10px 14px; cursor: pointer; font-size: 15px; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tab.active { color: var(--text); border-bottom-color: var(--primary); font-weight: 500; }
.auth-form { display: flex; flex-direction: column; gap: 12px; }

/* App page */
.app { padding: 32px 24px 80px; }
.meta { color: var(--muted); font-size: 14px; margin-top: 0; }
#resultArtifacts { display: grid; gap: 12px; }
.artifact { background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.artifact h4 { margin: 0 0 6px; font-size: 13px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.artifact pre { margin: 0; white-space: pre-wrap; word-break: break-word; font-family: inherit; font-size: 14px; }

.history-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.history-row:last-child { border-bottom: none; }
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.tag--ok { background: #e6f4ea; color: #1e7c3a; }
.tag--fail { background: #fde7e9; color: var(--error); }
.tag--pending { background: #fff4e1; color: #b06700; }

/* Footer */
.footer { padding: 30px 0; color: var(--muted); border-top: 1px solid var(--border); margin-top: 40px; }
