/* FlowTag participant door — mobile column + desktop (≥900px) two-pane. */
:root {
  --ft-ink: #0b1220;
  --ft-muted: #667085;
  --ft-line: rgba(15, 23, 42, 0.08);
  --ft-paper: #f4f7fb;
  --ft-card: #ffffff;
  --ft-teal: #0f766e;
  --ft-navy: #132a4f;
  --ft-success-bg: #ecfdf5;
  --ft-success-ink: #065f46;
  --ft-success-border: #a7f3d0;
  --ft-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  --ft-font: "Sora", "Segoe UI", sans-serif;
  --ft-display: "Syne", "Sora", sans-serif;
  --ft-grad: linear-gradient(125deg, #132a4f 0%, #0f766e 58%, #49a078 100%);
}

* { box-sizing: border-box; }

body.ft-portal {
  margin: 0;
  min-height: 100vh;
  color: var(--ft-ink);
  font-family: var(--ft-font);
  /* Brand-tinted ambient page surface (not flat gray) */
  background:
    radial-gradient(900px 480px at 50% -8%, rgba(15, 118, 110, 0.28), transparent 55%),
    linear-gradient(180deg, #e6f4f2 0%, #eef7f5 40%, #e8f1ef 100%);
}

.ft-portal-layout {
  width: min(480px, 100%);
  margin: 0 auto;
  padding: 20px 20px 40px;
  display: flex;
  flex-direction: column;
}

@media (min-width: 768px) and (max-width: 899px) {
  .ft-portal-layout { padding-top: 48px; }
}

/* Brand bar — ~56px (mobile) */
.ft-portal-topbar {
  order: 1;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  background: transparent;
}

.ft-portal-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.ft-portal-logo img {
  height: 28px;
  width: auto;
  display: block;
}

.ft-portal-logo-panel { display: none; }

/* Language switcher */
.ft-lang-switch { position: relative; z-index: 20; margin-left: auto; }
.ft-lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 78px;
  height: 34px;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.88);
  color: var(--ft-ink);
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(8, 18, 36, 0.08);
  font: inherit;
}
.ft-lang-btn img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.ft-lang-btn span { font-size: 0.86rem; font-weight: 700; }
.ft-lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: #0b1220;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  z-index: 30;
}
.ft-lang-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0.62rem 0.95rem;
  color: rgba(255, 255, 255, 0.92);
  text-decoration: none;
  font-size: 0.88rem;
}
.ft-lang-menu a:hover { background: color-mix(in srgb, var(--ft-teal) 28%, transparent); }
.ft-lang-menu img { width: 24px; height: 16px; object-fit: cover; border-radius: 2px; }
.d-none { display: none !important; }
[hidden] { display: none !important; }

/* Brand panel = hero card on mobile */
.ft-portal-brand-panel {
  order: 2;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border-radius: 20px;
  padding: 24px;
  color: #fff;
  margin-bottom: 16px;
  background: var(--ft-grad);
  box-shadow: 0 18px 40px rgba(15, 46, 70, 0.18);
}

.ft-portal-deco {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.ft-portal-deco::before,
.ft-portal-deco::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
}
.ft-portal-deco::before {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -80px;
}
.ft-portal-deco::after {
  width: 420px;
  height: 420px;
  bottom: -180px;
  left: -140px;
  background: rgba(255, 255, 255, 0.08);
}

.ft-portal-brand-panel-body {
  position: relative;
  z-index: 1;
}

.ft-portal-hero-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.ft-portal-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.15);
  font-size: 1.15rem;
  flex-shrink: 0;
}

.ft-portal-hero-brand strong {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.ft-portal-hero-brand span {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.9;
  line-height: 1.3;
}

.ft-portal-brand-panel h1 {
  margin: 0 0 10px;
  font-family: var(--ft-display);
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
}

.ft-portal-lead {
  margin: 0;
  font-size: 15px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.85);
  max-width: 46ch;
}

/* Trust bullets — desktop panel only */
.ft-portal-trust-list {
  display: none;
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  gap: 12px;
}

.ft-portal-trust-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.ft-portal-trust-list i {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  margin-top: 1px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 0.65rem;
}

.ft-portal-actions {
  order: 3;
  width: 100%;
}

/* Action / continue cards */
.ft-portal-card {
  background: var(--ft-card);
  border: 1px solid var(--ft-line);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 16px;
  box-shadow: var(--ft-shadow);
}

.ft-portal-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 18px;
}

.ft-portal-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--ft-teal) 10%, transparent);
  color: var(--ft-teal);
  font-size: 1rem;
}

.ft-portal-card-head h2 {
  margin: 0 0 4px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ft-ink);
}

.ft-portal-card-head p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ft-muted);
}

.ft-portal-form { display: grid; gap: 0; }
.ft-portal-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  margin-bottom: 6px;
}

.ft-portal-input {
  width: 100%;
  height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  background: #fff;
  color: var(--ft-ink);
}

.ft-portal-input:focus {
  outline: none;
  border-color: var(--ft-teal);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ft-teal) 35%, transparent);
}

.ft-portal-code {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.35em;
  padding-left: 0.7em;
}

.ft-portal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 50px;
  margin-top: 14px;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  background: var(--ft-teal);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}

.ft-portal-btn:hover { filter: brightness(1.05); color: #fff; }
.ft-portal-btn:disabled { opacity: 0.7; cursor: wait; filter: none; }
.ft-portal-btn-dark { background: var(--ft-navy); }

.ft-portal-trust {
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ft-muted);
}

.ft-portal-code-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--ft-muted);
}

.ft-portal-success {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 14px;
  border-radius: 12px;
  background: var(--ft-success-bg);
  border: 1px solid var(--ft-success-border);
  color: var(--ft-success-ink);
}

.ft-portal-success i {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #059669;
  color: #fff;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-top: 1px;
}

.ft-portal-success p {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.45;
}

.ft-portal-continue-list {
  display: grid;
  gap: 10px;
  margin-top: 4px;
}

.ft-portal-continue-list .ft-portal-btn { margin-top: 0; }

.ft-portal-continue-meta {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0.9;
}

.ft-portal-alert {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
}

.ft-portal-feedback {
  margin: 10px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: #b42318;
}

.ft-portal-foot {
  text-align: center;
  margin-top: 24px;
  padding-top: 4px;
  font-size: 13px;
  color: var(--ft-muted);
  line-height: 1.6;
}

.ft-portal-foot-brand {
  display: block;
  font-weight: 700;
  color: #475569;
  margin-bottom: 4px;
}

.ft-portal-foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0;
  align-items: center;
}

.ft-portal-foot-links a {
  color: var(--ft-muted);
  text-decoration: none;
  font-weight: 600;
}

.ft-portal-foot-links a:hover { color: var(--ft-teal); text-decoration: underline; }

.ft-portal-foot-sep {
  margin: 0 0.45rem;
  opacity: 0.55;
  user-select: none;
}

/* ========== Desktop ≥900px: two columns fill the viewport ========== */
@media (min-width: 900px) {
  body.ft-portal {
    background: #e6f4f2;
  }

  .ft-portal-layout {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(420px, 1fr) min(520px, 46vw);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "brand top"
      "brand actions";
  }

  .ft-portal-brand-panel {
    grid-area: brand;
    order: unset;
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    min-height: 100vh;
    height: 100%;
    padding: 48px;
    display: flex;
    flex-direction: column;
  }

  .ft-portal-logo-panel {
    display: inline-flex;
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.94);
    padding: 8px 12px;
    border-radius: 10px;
    width: fit-content;
    flex-shrink: 0;
  }

  .ft-portal-brand-panel-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 34rem;
  }

  .ft-portal-brand-panel h1 {
    font-size: 34px;
  }

  .ft-portal-trust-list {
    display: grid;
  }

  .ft-portal-topbar {
    grid-area: top;
    order: unset;
    height: auto;
    margin: 0;
    padding: 48px 48px 0;
    justify-content: flex-end;
    background: var(--ft-paper);
  }

  .ft-portal-logo-mobile { display: none; }

  .ft-portal-actions {
    grid-area: actions;
    order: unset;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    padding: 24px 48px 48px;
    background: var(--ft-paper);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 0;
  }

  .ft-portal-actions .ft-portal-card:last-of-type {
    margin-bottom: 0;
  }

  .ft-portal-foot {
    margin-top: 24px;
  }
}

@media (min-width: 900px) and (max-height: 820px) {
  .ft-portal-actions {
    justify-content: flex-start;
    padding-top: 16px;
    padding-bottom: 32px;
    overflow-y: auto;
  }
  .ft-portal-brand-panel-body {
    justify-content: flex-start;
    padding-top: 24px;
  }
}
