:root {
  --bg-gradient: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
  --panel-bg: #0f0f1a;
  --panel-2: #161627;
  --text: #fff;
  --text-muted: #9a9ab0;
  --border: #26263a;
  --accent: #4a9eff;
  --accent-hover: #2f86ec;
  --accent-dark: #1e3a5f;
  --aws: #ff9900;
  --success-bg: #1e4620; --success-fg: #6ee06e;
  --error-bg: #4a1515;   --error-fg: #ff6b6b;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: #1a1a2e;
  background: var(--bg-gradient);
  background-attachment: fixed;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  line-height: 1.55;
}

.wrap { max-width: 980px; margin: 0 auto; padding: 32px 16px 80px; }

.brand { display: flex; justify-content: center; margin-bottom: 24px; }
.brand img { width: 120px; height: auto; display: block; filter: drop-shadow(0 8px 24px rgba(245,197,24,.18)); }

.card {
  background: var(--panel-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 36px;
  box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.step { display: none; animation: fade .25s ease; }
.step.active { display: block; }
#intro, #quiz, #fail { max-width: 720px; margin: 0 auto; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

h1 { font-size: 2.2rem; line-height: 1.15; margin: 14px 0 12px; letter-spacing: -0.02em; }
h2 { font-size: 1.3rem; line-height: 1.35; margin: 18px 0 18px; }
.lead { font-size: 1.1rem; color: #d6d6e4; margin: 0 0 24px; }
.muted { color: var(--text-muted); }
.hint { color: var(--text-muted); font-size: .85rem; margin: 6px 0 16px; }
hr { border: 0; border-top: 1px solid var(--border); margin: 36px 0 8px; }

.label {
  text-transform: uppercase; letter-spacing: .05em;
  font-size: .75rem; color: var(--text-muted); font-weight: 600;
}

.pill {
  display: inline-block; padding: 4px 12px; border-radius: 20px;
  font-size: .8rem; font-weight: 600;
  background: rgba(255,153,0,.14); color: var(--aws);
}
.pill.subtle  { background: var(--accent-dark); color: #bcd8ff; }
.pill.success { background: var(--success-bg); color: var(--success-fg); }
.pill.error   { background: var(--error-bg);   color: var(--error-fg); }

.meta { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; }
.meta li { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: baseline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 8px; padding: 12px 22px;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  transition: background .15s, opacity .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; }
.btn.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn.secondary:hover { background: #1f1f35; }
.btn.ghost { background: transparent; color: var(--accent); padding: 8px 4px; }
.btn.big { padding: 16px 32px; font-size: 1.1rem; }
.btn.linkedin { background: #0a66c2; color: #fff; }
.btn.linkedin:hover { background: #004182; }
.btn.linkedin:disabled { opacity: .6; cursor: progress; }

.li-box { background: var(--panel-2); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin-bottom: 20px; }
.li-box .hint { margin-bottom: 0; }
.li-box > .btn.linkedin { width: 100%; }
.li-user { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; }
.li-success { display: flex; flex-direction: column; gap: 6px; border-color: var(--success-fg); background: var(--success-bg); }
.li-success a { color: var(--success-fg); font-weight: 600; }

/* Quiz */
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.progress { height: 6px; background: var(--panel-2); border-radius: 4px; margin-top: 12px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: var(--aws); transition: width .3s ease; }

.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 14px; align-items: flex-start; text-align: left;
  width: 100%; padding: 14px 16px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--border);
  color: var(--text); font: inherit; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.option:hover { border-color: #3a3a58; }
.option[aria-checked="true"] { border-color: var(--accent); background: var(--accent-dark); }
.option .key {
  flex: none; width: 26px; height: 26px; border-radius: 6px;
  display: grid; place-items: center; font-size: .8rem; font-weight: 700;
  background: #23233a; color: var(--text-muted);
}
.option[aria-checked="true"] .key { background: var(--accent); color: #fff; }
.actions { display: flex; justify-content: flex-end; margin-top: 24px; }

/* Review */
.review { display: grid; gap: 14px; margin: 20px 0 28px; }
.review-item { background: var(--panel-2); border: 1px solid var(--border); border-left: 4px solid var(--error-fg); border-radius: 8px; padding: 14px 16px; }
.review-item.ok { border-left-color: var(--success-fg); }
.review-item p { margin: 6px 0; }
.review-item .q { font-weight: 600; }
.review-item .bad  { color: var(--error-fg); }
.review-item .good { color: var(--success-fg); }
.review-item .why  { color: var(--text-muted); font-size: .92rem; }

/* Badge */
.badge-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; margin-top: 20px; align-items: start; }
.badge-form { display: flex; flex-direction: column; }
.badge-form .label { margin-bottom: 6px; }
input[type="text"], textarea {
  width: 100%; background: var(--panel-2); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px; font: inherit; margin-bottom: 18px;
}
textarea { resize: vertical; font-size: .92rem; margin-bottom: 4px; }
input:focus, textarea:focus { outline: none; border-color: var(--accent); }
.photo-row { display: flex; gap: 10px; align-items: center; }
.file-btn { cursor: pointer; }
.badge-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 4px 0 24px; }
.badge-actions #share-btn { width: 100%; }
.badge-form .btn.ghost { align-self: flex-start; }
.badge-preview canvas {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 20px 50px rgba(0,0,0,.45);
}

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
  background: #fff; color: #111; padding: 10px 18px; border-radius: 8px;
  font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 700px) {
  .wrap { padding-top: 24px; }
  .card { padding: 22px 18px; }
  h1 { font-size: 1.7rem; }
  h2 { font-size: 1.12rem; }
  .badge-grid { grid-template-columns: minmax(0, 1fr); }
  .badge-preview { order: -1; }
  .btn.big { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
