/* =========================================================
   MAD Rescue - App UI (clean, single-source-of-truth)
   Goal:
   - One centered “app card” across all templates
   - Stable card size; content scrolls inside
   - Logo size controlled by body class:
       body.logo-regular  (big centered logo)
       body.logo-compact  (small top-left logo)
   ========================================================= */

/* ---------- Theme tokens ---------- */
:root {
  --bg: #0b1220;
  --text: rgba(255,255,255,0.92);
  --muted: rgba(255,255,255,0.70);
  --stroke: rgba(255,255,255,0.12);
  --cardTop: rgba(255,255,255,0.08);
  --cardBottom: rgba(255,255,255,0.05);
  --shadow: 0 18px 45px rgba(0,0,0,0.45);

  --radius: 18px;

  /* App card sizing */
  --shellMax: 860px;     /* card width cap */
  --cardMinH: 680px;     /* stable "app" feel */
  --pad: 26px;           /* inner padding */
}

/* ---------- Base resets ---------- */
* { box-sizing: border-box; }
/* Let the page grow with its content so the background gradient spans the
   whole page instead of tiling every screen-height. */
html { min-height: 100%; }
body { min-height: 100vh; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial,
    "Apple Color Emoji","Segoe UI Emoji";
  color: var(--text);
  background:
    radial-gradient(1000px 600px at 20% 10%, rgba(124,77,255,0.25), transparent 55%),
    radial-gradient(900px 500px at 90% 20%, rgba(100,210,255,0.20), transparent 60%),
    radial-gradient(1200px 800px at 50% 100%, rgba(255,255,255,0.06), transparent 60%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }

/* ---------- App shell ---------- */
.wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 16px;
}

.shell {
  width: 100%;
  max-width: var(--shellMax);
}

/* ---------- Card ---------- */
.card {
  background: linear-gradient(180deg, var(--cardTop), var(--cardBottom));
  border: 1px solid var(--stroke);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;

  /* Stable app card size */
  width: 100%;
  min-height: var(--cardMinH);

  display: flex;
  flex-direction: column;
}

.card-inner {
  padding: var(--pad);
  flex: 1;
  overflow: auto; /* critical: long forms scroll inside card */
}

@media (min-width: 720px) {
  :root { --pad: 34px; }
}

/* ---------- Logo ---------- */
/* Default: regular (welcome screens): big centered logo */
.app-logo {
  display: block;
  height: auto;
  max-width: 240px;
  margin: 0 auto 16px;
}

/* Compact (forms/portal): smaller, top-left inside card */
body.logo-compact .app-logo {
  max-width: 120px;
  margin: 0 0 12px 0;
}

/* ---------- Typography ---------- */
h1 {
  margin: 0 0 10px 0;
  font-size: 26px;
  line-height: 1.2;
  letter-spacing: 0.2px;
}
p {
  margin: 0 0 16px 0;
  color: var(--muted);
  line-height: 1.5;
}

/* ---------- Forms ---------- */
label {
  display: block;
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin: 0 0 6px 0;
}

input, select, textarea {
  width: 100%;
  padding: 12px 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.25);
  color: var(--text);
  outline: none;
}

input:focus, select:focus, textarea:focus {
  border-color: rgba(100,210,255,0.55);
  box-shadow: 0 0 0 4px rgba(100,210,255,0.12);
}

/* Simple two-column form grid utility (optional) */
.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
@media (min-width: 720px) {
  .form-grid { grid-template-columns: 1fr 1fr; gap: 16px; }
  .form-grid .span-2 { grid-column: 1 / -1; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.16);
  background: rgba(255,255,255,0.10);
  color: var(--text);
  cursor: pointer;
  font-weight: 650;
  letter-spacing: 0.2px;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
  user-select: none;
}
.btn:hover {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.22);
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  border-color: rgba(100,210,255,0.35);
  background: linear-gradient(135deg, rgba(100,210,255,0.20), rgba(124,77,255,0.16));
}
.btn-primary:hover {
  border-color: rgba(100,210,255,0.55);
  background: linear-gradient(135deg, rgba(100,210,255,0.26), rgba(124,77,255,0.20));
}

/* ---------- Alerts / help text ---------- */
.help {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,255,255,0.55);
}
.error {
  margin-top: 6px;
  font-size: 12px;
  color: rgba(255,120,120,0.95);
}
.alert {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,120,120,0.35);
  background: rgba(255,120,120,0.12);
  color: var(--text);
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 12px;
  color: rgba(255,255,255,0.55);
  font-size: 12px;
  text-align: center;
}

/* =========================================================
   ACTION TILES (Choose / Landing screens)
   ========================================================= */

.tiles {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 20px;
}

@media (min-width: 720px) {
  .tiles {
    grid-template-columns: 1fr 1fr;
  }
}

.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;

  padding: 20px;
  border-radius: 16px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);

  transition:
    transform .12s ease,
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;

  cursor: pointer;
  text-decoration: none;
  color: inherit;

  min-height: 150px;
}

.tile::before {
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    600px 260px at 20% 20%,
    rgba(100,210,255,0.14),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0.9;
}

.tile:hover {
  transform: translateY(-3px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.26);
  box-shadow: 0 14px 32px rgba(0,0,0,0.45);
}

.tile h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 650;
  letter-spacing: 0.2px;
}

.tile p {
  margin: 0;
  font-size: 14px;
  color: rgba(255,255,255,0.60);
}

.tile .go {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;

  font-weight: 650;
  font-size: 14px;
  color: rgba(100,210,255,0.95);
}
.tile .icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 26px;              /* emoji size */
  line-height: 1;

  background: linear-gradient(
    135deg,
    rgba(100,210,255,0.22),
    rgba(124,77,255,0.22)
  );

  border: 1px solid rgba(255,255,255,0.22);
  box-shadow: 0 8px 22px rgba(0,0,0,0.35);
}
.tile:hover .icon {
  transform: scale(1.05);
  box-shadow: 0 10px 26px rgba(0,0,0,0.45);
}

/* =========================
   LANDING PAGE POLISH
   ========================= */

.form-panel {
  margin-top: 28px;
  padding: 24px;
  border-radius: 16px;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.10);
}

.form-panel .btn-primary {
  margin-top: 16px;
  font-size: 16px;
  padding: 14px 22px;
}

/* Soft divider below CTA */
.home-divider {
  margin: 28px 0 16px;
  height: 1px;
  background: linear-gradient(
    to right,
    transparent,
    rgba(255,255,255,0.18),
    transparent
  );
}

/* Lift hero logo slightly so page doesn’t feel bottom-heavy */
body.logo-regular .app-logo {
  margin-top: -12px;
}

/* ===== Submit topic tiles ===== */

/* ===============================
   Submit Topic Tiles
   =============================== */

/* ===============================
   Submit Topic Tiles (3 x 4 grid)
   =============================== */

/* --- Topic tiles: uniform size + 3-line max title --- */
/* --- Topic tiles: compact 3x grid, keep the "sexy tile" look --- */
.topic-tiles{
  display:grid;
  gap: 12px;
  margin-top: 16px;
  grid-template-columns: 1fr;
}

@media (min-width: 720px){
  .topic-tiles{
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* 3 across */
  }
}

.topic-tile{
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;

  padding: 14px;
  border-radius: 16px;

  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);

  transition:
    transform .12s ease,
    background .12s ease,
    border-color .12s ease,
    box-shadow .12s ease;

  cursor: pointer;
  text-decoration: none;
  color: inherit;

  min-height: 80px;   /* smaller */
}

.topic-tile::before{
  content: "";
  position: absolute;
  inset: -1px;
  background: radial-gradient(
    520px 220px at 20% 20%,
    rgba(100,210,255,0.14),
    transparent 60%
  );
  pointer-events: none;
  opacity: 0.9;
}

.topic-tile:hover{
  transform: translateY(-2px);
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.26);
  box-shadow: 0 12px 28px rgba(0,0,0,0.45);
}

.topic-tile-title{
  margin: 0;
  font-size: 14px;     /* smaller title */
  font-weight: 650;
  letter-spacing: 0.1px;

  display: -webkit-box;
  -webkit-line-clamp: 3;          /* max 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.25;
  max-height: calc(1.25em * 3);
}

/* ===== Lock app card size across pages (only inner scrolls) ===== */

.wrap{
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px 14px;
}

.shell{
  width: min(960px, 100%);
}

.card{
  /* consistent "app card" size: fills the screen when content is short,
     grows with the page (no inner scrollbar) when content is longer */
  min-height: min(960px, calc(100svh - 80px));
  width: 100%;
  overflow: hidden; /* keeps content inside the rounded corners */
}

.card-inner{
  padding-bottom: 24px; /* breathing room at bottom */
}

/* --- fix: keep card+footer centered together --- */
.shell {
  max-width: 760px;
  margin-left: auto;
  margin-right: auto;
}

.card {
  width: 100%;
}

/* footer should align with the centered shell/card */
.footer {
  width: 100%;
  text-align: center;
}

/* --- fix: make Cancel and Submit identical sizing --- */
.row-actions {
  display: flex;
  gap: 12px;
  align-items: stretch;
}

.row-actions .btn,
.row-actions button.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 16px;
  line-height: 1;
  border-radius: 12px;
}

/* ---------- Radios & checkboxes ----------
   The input rule above is meant for text boxes; without this, radio buttons
   and checkboxes stretch to full width and float away from their labels. */
input[type="radio"],
input[type="checkbox"] {
  width: auto;
  padding: 0;
  margin: 0;
  flex: none;
  accent-color: #64d2ff;
}

/* ---------- Payment method choice (PayPal / Paper Check) ---------- */
.payment-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.toggle-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(0,0,0,0.22);
  color: var(--text);
  font-size: 14px;
  cursor: pointer;
}
.toggle-option:has(input:checked) {
  border-color: rgba(100,210,255,0.55);
  background: rgba(100,210,255,0.12);
}
