/* ---------- buttons ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  padding: 9px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease),
              transform .12s var(--ease), box-shadow .15s var(--ease), opacity .15s var(--ease);
}
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.btn-primary {
  background: var(--brand-600);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79, 70, 229, .3);
}
.btn-primary:hover:not(:disabled) { background: var(--brand-700); box-shadow: 0 4px 14px rgba(79, 70, 229, .38); }
[data-theme="dark"] .btn-primary { background: var(--brand-500); }
[data-theme="dark"] .btn-primary:hover:not(:disabled) { background: var(--brand-400); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover:not(:disabled) { border-color: var(--line-strong); background: var(--surface-2); }

.btn-accent {
  background: linear-gradient(135deg, var(--accent-500), var(--accent-600));
  color: #241a04;
  box-shadow: 0 2px 10px rgba(217, 119, 6, .3);
}
.btn-accent:hover:not(:disabled) { filter: brightness(1.05); }

.btn-danger { background: var(--bad-bg); color: var(--bad-fg); border-color: var(--bad-line); }
.btn-danger:hover:not(:disabled) { background: var(--bad-fg); color: #fff; }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: var(--r-sm); gap: 5px; }
.btn-block { width: 100%; }

.icon-btn {
  width: 30px; height: 30px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: color .15s var(--ease), border-color .15s var(--ease), background .15s var(--ease);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.icon-btn.danger:hover { color: var(--bad-fg); border-color: var(--bad-line); background: var(--bad-bg); }

/* ---------- form fields ---------- */

.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .045em;
}
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }

input[type=text], input[type=password], textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 9px 11px;
  font-size: 13.5px;
  font-family: var(--font-body);
  background: var(--surface);
  color: var(--text);
  outline: none;
  resize: vertical;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--text-3); }

/* ---------- pills, tags, cards ---------- */

.kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--text-2);
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
}
.tag {
  background: var(--brand-soft);
  color: var(--brand-text);
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-weight: 600;
}
.tag.tag-accent { background: var(--warn-bg); color: var(--warn-fg); }
.tag.tag-ok { background: var(--ok-bg); color: var(--ok-fg); }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.banner {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 12px 15px;
  border-radius: var(--r-md);
  font-size: 13px;
  line-height: 1.55;
  border: 1px solid;
}
.banner svg { flex-shrink: 0; margin-top: 2px; }
.banner-warn { background: var(--warn-bg); color: var(--warn-fg); border-color: var(--warn-line); }
.banner-bad  { background: var(--bad-bg);  color: var(--bad-fg);  border-color: var(--bad-line); }
.banner-info { background: var(--brand-soft); color: var(--brand-text); border-color: var(--brand-200); }
[data-theme="dark"] .banner-info { border-color: var(--brand-700); }

/* ---------- modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 19, .55);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  z-index: 60;
  padding: 20px;
  animation: fade-in .18s var(--ease);
}
.modal {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-xl);
  animation: pop-in .22s var(--ease);
}
.modal h3 { font-size: 17px; margin-bottom: 4px; }
.modal .modal-sub { font-size: 12.5px; color: var(--text-2); margin-bottom: 18px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

@keyframes fade-in { from { opacity: 0; } }
@keyframes pop-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(14px);
  background: var(--nav-bg);
  color: #fff;
  border: 1px solid var(--nav-line);
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
  box-shadow: var(--shadow-lg);
  max-width: min(92vw, 520px);
  display: flex;
  align-items: center;
  gap: 9px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.bad { background: var(--bad-fg); border-color: var(--bad-fg); }
.toast.ok  { background: #047857; border-color: #047857; }

/* ---------- lightbox ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 13, .93);
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
  animation: fade-in .18s var(--ease);
  cursor: zoom-out;
}
.lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-xl);
}
.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  background: rgba(255, 255, 255, .12);
  border: 0;
  color: #fff;
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.lightbox-close:hover { background: rgba(255, 255, 255, .22); }

/* ---------- skeleton / empty ---------- */

.empty-state {
  text-align: center;
  padding: 70px 24px;
  color: var(--text-2);
  margin: auto;
  max-width: 460px;
}
.empty-state .empty-icon {
  width: 62px; height: 62px;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  color: var(--text-3);
}
.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }
.empty-state p { font-size: 13.5px; line-height: 1.6; }

.boot {
  display: grid;
  place-items: center;
  height: 100dvh;
  width: 100%;
  gap: 14px;
  color: var(--text-3);
  font-size: 13.5px;
}
.spinner {
  width: 26px; height: 26px;
  border: 2.5px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------
   Jira issue collector
   The widget can only be loaded once, so its trigger tab is hidden
   whenever the learner is not on a slide (see js/feedback.js).
   ------------------------------------------------------------------ */
#atlwdg-trigger { display: none; }
body.feedback-on #atlwdg-trigger { display: block; }
