/* ============================================================
   app-page.css — minimal chrome for the 3 method pages
   (widget.html / modal.html / redirect.html / callback.html).

   Branding comes from the theme engine (apps.js) via the
   --accent / --grad variables set on <html>. The widget's own
   look comes from the end-user-nano variables in styles.css —
   the same ones apps.js overrides per app.
   ============================================================ */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
  background: #f1f4f9;
  color: #1a2433;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- brand header ---------- */

header {
  background: linear-gradient(135deg, var(--grad));
  color: #fff;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.brand {
  font-weight: 700;
  font-size: 1.1rem;
  flex: 1;
}

.back-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
  white-space: nowrap;
}

.back-link:hover {
  background: rgba(255, 255, 255, 0.24);
}

.badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 999px;
  padding: 0.28rem 0.75rem;
}

.badge a {
  color: #fff;
  text-decoration: none;
}

/* ---------- action row (Register / Sign In) ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.75rem 1rem 3rem;
}

.tagline {
  color: #4a5568;
  font-size: 0.95rem;
  margin: 0 0 1.4rem;
}

.cta-row {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
}

.btn {
  flex: 1;
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  padding: 0.7rem 1.4rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  filter: brightness(0.92);
}

.btn-outline {
  background: #fff;
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------- widget / page area ---------- */

.widget-panel {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(15, 30, 60, 0.08);
  overflow: hidden;
}

.widget-note {
  font-size: 0.78rem;
  color: #64748b;
  line-height: 1.5;
  margin: 0 0 1rem;
}

#widgetContainer {
  min-height: 420px;
  padding: 1.25rem 1.5rem 1.5rem;
}

.widget-error {
  margin: 0 0 1rem;
  padding: 1rem;
  background: #fdf3f3;
  border: 1px dashed #d8a0a0;
  border-radius: 10px;
  color: #7a3030;
  font-size: 0.85rem;
  line-height: 1.5;
}

/* ---------- modal (modal.html only) ---------- */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 30, 60, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 100;
}

.overlay[hidden] {
  display: none;
}

.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.3);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.1rem;
  border-bottom: 1px solid #e2e8f0;
}

.modal-head h2 {
  margin: 0;
  font-size: 0.95rem;
  color: #4a5568;
  font-weight: 600;
}

.modal-close {
  font: inherit;
  background: none;
  border: none;
  font-size: 1.3rem;
  line-height: 1;
  color: #64748b;
  cursor: pointer;
  padding: 0.2rem 0.4rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f1f4f9;
}

.modal .overlay-note,
.modal-note {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0 1.25rem;
  padding-top: 0.9rem;
}

.modal #widgetContainer {
  min-height: 380px;
}

/* ---------- callback card (callback.html only) ---------- */

.callback-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-top: 5px solid var(--accent);
  border-radius: 14px;
  padding: 1.6rem;
  box-shadow: 0 8px 24px rgba(15, 30, 60, 0.08);
}

.callback-card h2 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.callback-card p.status {
  color: #4a5568;
  line-height: 1.6;
  margin: 0 0 1.2rem;
  font-size: 0.9rem;
}

.claims {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 1rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.8rem;
  line-height: 1.7;
  overflow-x: auto;
  margin: 0 0 1.2rem;
}

.claims div {
  white-space: nowrap;
}

.claims .k {
  color: #64748b;
}

.callback-card a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.callback-card a:hover {
  text-decoration: underline;
}

footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.75rem;
  color: #64748b;
}

footer a {
  color: var(--accent);
}
