/* ─────────────────────────────────────────────────────────────────
   FATCA / CRS Survey — shared visual primitives
   ─────────────────────────────────────────────────────────────────
   The `.fatca-*` rhythm vocabulary used by the FATCA-CRS survey
   pages (FatcaPF202010, FatcaPG202010, FatcaFIAUE202010). Lifted
   from FatcaPF's scoped block so all sibling pages share one
   source of truth: page wrapper, semantic notice cards,
   navy-gradient hero identity card, intro card for the
   regulatory disclaimer, instructions-download link chip, and
   dialog intro cards (info / warn / danger / success).

   Family resemblance with public/css/aml-survey.css is intentional
   — both flows are sibling compliance surveys.
   ────────────────────────────────────────────────────────────── */

/* ── Page wrapper ────────────────────────────────────────────────
   Vertical-rhythm flex container. Mirrors .aml-page so the two
   compliance flows feel like siblings, not strangers. */
.fatca-page {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-width: 980px;
  margin: 0 auto;
  color: #1e293b;
}

.fatca-page > .pp-section,
.fatca-page > .fatca-page > .pp-section {
  margin: 0;
}

/* ── Question stack ──────────────────────────────────────────────
   Uniform vertical rhythm between sibling questions inside a
   PagePart. The `> * + *` selector applies the gap only between
   siblings, so conditionally-rendered questions (v-if) collapse
   cleanly. */
.fatca-question-stack > * + * {
  margin-top: 1.4rem;
}

/* ── Notes block ─────────────────────────────────────────────────
   White card shell + stacked FormFieldComponent caption + spacious
   textarea. Replaces the legacy <h3> + form-control pattern. */
.fatca-notes-block {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 0.95rem 1.15rem 1.15rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
  margin-top: 1.5rem;
}

.fatca-notes-textarea {
  width: 100%;
  min-height: 7rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.fatca-notes-textarea textarea {
  width: 100%;
  min-height: 7rem;
  padding: 0.65rem 0.85rem;
  color: #1f2937;
}

/* ── Top-of-page notices ─────────────────────────────────────────
   Three accented info cards (warn / danger / info) replacing the
   legacy bootstrap .alert blocks. */
.fatca-notices {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin: 0 0 1rem;
}

.fatca-notice {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-left: 4px solid rgb(0, 73, 118);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.fatca-notice-icon {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(0, 73, 118, 0.08);
  color: rgb(0, 73, 118);
  font-size: 0.95rem;
}

.fatca-notice-body {
  flex: 1 1 auto;
  min-width: 0;
}

.fatca-notice-title {
  margin: 0 0 0.15rem;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.3;
}

.fatca-notice-text {
  margin: 0;
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
}

.fatca-notice--warn { border-left-color: #d97706; }
.fatca-notice--warn .fatca-notice-icon {
  background: #fffbea;
  color: #b45309;
}

.fatca-notice--danger { border-left-color: #b91c1c; }
.fatca-notice--danger .fatca-notice-icon {
  background: #fff5f5;
  color: #b91c1c;
}

.fatca-notice--info { border-left-color: rgb(0, 73, 118); }

/* ── Hero card ───────────────────────────────────────────────────
   Same gradient body + 56px rail + fact grid as .aml-hero. The
   rail tag and eyebrow icon (globe-americas) are FATCA-specific
   to signal the tax-residency framing. */
.fatca-hero {
  position: relative;
  display: flex;
  background: linear-gradient(145deg, #001f33 0%, #004976 55%, #002d4a 100%);
  color: #ffffff;
  border-radius: 14px;
  margin: 0 0 1.25rem;
  overflow: hidden;
  box-shadow: 0 6px 22px rgba(0, 73, 118, 0.18);
}

.fatca-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 20%, rgba(255, 255, 255, 0.1) 0%, transparent 35%),
    radial-gradient(circle at 92% 100%, rgba(255, 105, 0, 0.18) 0%, transparent 45%);
  pointer-events: none;
}

.fatca-hero-rail {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  background: rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1;
}

.fatca-hero-rail-tag {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  color: rgba(255, 255, 255, 0.6);
}

.fatca-hero-body {
  flex: 1 1 auto;
  padding: 1.4rem 1.6rem 1.5rem;
  position: relative;
  z-index: 1;
  min-width: 0;
}

.fatca-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.fatca-hero-title {
  margin: 0.45rem 0 0.5rem;
  font-size: 1.55rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: #ffffff;
  word-break: break-word;
}

.fatca-hero-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
  font-size: 0.82rem;
  color: rgba(255, 255, 255, 0.85);
}

.fatca-hero-meta-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  font-size: 0.66rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #ffffff;
}

.fatca-hero-meta-text {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 500;
}

.fatca-hero-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0.85rem;
  margin-top: 1.2rem;
  padding-top: 1.1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.fatca-hero-fact {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.fatca-hero-fact-label {
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.6);
}

.fatca-hero-fact-value {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #ffffff;
  letter-spacing: 0.005em;
  word-break: break-word;
}

.fatca-hero-fact-value--locked { color: #fde68a; }

.fatca-hero-fact-icon {
  font-size: 0.85rem;
  opacity: 0.85;
}

/* ── Intro card (regulatory disclaimer at the top of every page) ──
   Stationery-style card with an ivory parchment gradient, navy
   hairline border, leading globe icon, and a small eyebrow tag
   carrying the FATCA/CRS reference. The first letter of the
   legal text is enlarged in navy as a subtle drop-cap so the
   wall of text reads less like a wall. Mirrors .aml-intro-card. */
.fatca-intro-card {
  position: relative;
  display: flex;
  gap: 1.05rem;
  padding: 1.15rem 1.3rem 1.2rem;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.95) 0%, rgba(248, 244, 235, 0.92) 100%),
    repeating-linear-gradient(
      45deg,
      rgba(0, 73, 118, 0.018) 0,
      rgba(0, 73, 118, 0.018) 1px,
      transparent 1px,
      transparent 6px
    );
  border: 1px solid #e7dec6;
  border-left: 4px solid rgb(0, 73, 118);
  border-radius: 0 12px 12px 0;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.fatca-intro-card::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 10px;
  width: 38px;
  height: 38px;
  background: radial-gradient(circle, rgba(0, 73, 118, 0.06) 0%, transparent 70%);
  border-radius: 50%;
  pointer-events: none;
}

.fatca-intro-card-icon {
  flex-shrink: 0;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-top: 0.15rem;
  border-radius: 12px;
  background: linear-gradient(140deg, rgba(0, 73, 118, 0.12) 0%, rgba(0, 73, 118, 0.06) 100%);
  border: 1px solid rgba(0, 73, 118, 0.18);
  color: rgb(0, 73, 118);
  font-size: 1.25rem;
  padding-top: 0.55rem;
  box-sizing: border-box;
  position: relative;
  z-index: 1;
}

.fatca-intro-card-body {
  flex: 1 1 auto;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.fatca-intro-card-eyebrow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.6rem;
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgb(0, 73, 118);
}

.fatca-intro-card-eyebrow-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: rgb(0, 73, 118);
  color: #ffffff;
  border-radius: 999px;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.fatca-intro-card-eyebrow-divider {
  display: inline-block;
  width: 18px;
  height: 1px;
  background: rgba(0, 73, 118, 0.35);
  margin: 0 0.05rem;
}

.fatca-intro-card-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #2d3748;
  text-align: justify;
  hyphens: auto;
}

.fatca-intro-card-text p,
.fatca-intro-card-text ol,
.fatca-intro-card-text ul {
  margin: 0.5rem 0 0;
}

.fatca-intro-card-text > :first-child {
  margin-top: 0;
}

.fatca-intro-card-text strong,
.fatca-intro-card-text b {
  color: rgb(0, 73, 118);
  font-weight: 600;
}

.fatca-intro-card-text em,
.fatca-intro-card-text i {
  color: #475569;
  font-style: italic;
}

/* Footer note inside the intro card — a small notice + download
   link separated by a thin hairline from the legal text above. */
.fatca-intro-card-footer {
  margin-top: 0.95rem;
  padding-top: 0.75rem;
  border-top: 1px dashed rgba(0, 73, 118, 0.22);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.84rem;
  color: #475569;
}

@media (max-width: 600px) {
  .fatca-intro-card { padding: 0.95rem 1rem; gap: 0.85rem; }
  .fatca-intro-card-icon { width: 38px; height: 38px; font-size: 1.1rem; padding-top: 0.4rem; }
  .fatca-intro-card-text { font-size: 0.88rem; }
}

/* ── Instructions download link ──────────────────────────────────
   Refined chip-style link replacing the bare anchor used to
   download the FATCA-CRS instructions PDF. Reads as a deliberate
   call to action: navy-tinted background, rounded pill, leading
   icon, and a subtle hover lift. Mirrors .aml-instructions-link. */
.fatca-instructions-link {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.55rem 1.05rem 0.55rem 0.85rem;
  background: linear-gradient(135deg, rgba(0, 73, 118, 0.07) 0%, rgba(0, 73, 118, 0.12) 100%);
  border: 1px solid rgba(0, 73, 118, 0.22);
  border-radius: 999px;
  color: rgb(0, 73, 118);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.fatca-instructions-link:hover,
.fatca-instructions-link:focus-visible {
  background: linear-gradient(135deg, rgba(0, 73, 118, 0.12) 0%, rgba(0, 73, 118, 0.2) 100%);
  border-color: rgba(0, 73, 118, 0.4);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 73, 118, 0.15);
  outline: none;
  text-decoration: none;
  color: rgb(0, 73, 118);
}

.fatca-instructions-link:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(0, 73, 118, 0.12);
}

.fatca-instructions-link-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgb(0, 73, 118);
  color: #ffffff;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.fatca-instructions-link-name {
  flex: 1 1 auto;
  text-align: left;
  word-break: break-word;
}

.fatca-instructions-link-arrow {
  font-size: 0.75rem;
  opacity: 0.6;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.fatca-instructions-link:hover .fatca-instructions-link-arrow,
.fatca-instructions-link:focus-visible .fatca-instructions-link-arrow {
  transform: translateX(2px);
  opacity: 1;
}

.fatca-intro-card-footer-prompt {
  flex: 1 1 auto;
  min-width: 220px;
  font-style: italic;
  color: #475569;
}

/* ── Dialog intro card ───────────────────────────────────────────
   Variants: info / warn / danger / success. Used by
   #fatcaSaveDialog, #fatcaImpersonateDialog, #fatcaConfirmDeleteDialog. */
.fatca-dialog-intro {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border-radius: 0 6px 6px 0;
  margin: 0.25rem 0;
}

.fatca-dialog-intro--info    { background: #f0f7ff; border-left: 3px solid rgb(0, 73, 118); }
.fatca-dialog-intro--warn    { background: #fffbea; border-left: 3px solid #d69e2e; }
.fatca-dialog-intro--danger  { background: #fff5f5; border-left: 3px solid #b91c1c; }
.fatca-dialog-intro--success { background: #ecfdf5; border-left: 3px solid #10b981; }

.fatca-dialog-intro-icon {
  flex: 0 0 auto;
  font-size: 1.35rem;
  margin-top: 0.05rem;
}

.fatca-dialog-intro--info    .fatca-dialog-intro-icon { color: rgb(0, 73, 118); }
.fatca-dialog-intro--warn    .fatca-dialog-intro-icon { color: #d69e2e; }
.fatca-dialog-intro--danger  .fatca-dialog-intro-icon { color: #b91c1c; }
.fatca-dialog-intro--success .fatca-dialog-intro-icon { color: #065f46; }

.fatca-dialog-intro-text {
  flex: 1 1 auto;
  font-size: 0.9rem;
  color: #2d3748;
  line-height: 1.55;
  word-break: break-word;
}

.fatca-dialog-intro-text strong {
  color: rgb(0, 73, 118);
  font-weight: 600;
}

/* ── Dialog max-width clamps ─────────────────────────────────────
   kendo-dialog has no maxWidth prop; the upper bound is set on
   the dialog wrapper here. Lower bounds are on each kendo-dialog
   via :minWidth, producing a tight content-fit window. The three
   FATCA pages share the same dialog IDs since only one renders
   at a time. */
.k-dialog:has(> #fatcaSaveDialog) { max-width: 520px; }
.k-dialog:has(> #fatcaConfirmDeleteDialog) { max-width: 480px; }
.k-dialog:has(> #fatcaImpersonateDialog) { max-width: 540px; }
.k-dialog:has(> #fatcaCopyFromDialog) { max-width: 540px; }

/* ── Nested question-stack ────────────────────────────────────────
   For sub-questions that depend on a parent dropdown's value. A
   thin navy left rail signals child-of-parent without requiring a
   hand-rolled 8em margin (the legacy .indent1 approach). */
.fatca-question-stack--nested {
  margin-left: 0;
  padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 2px solid rgba(0, 73, 118, 0.18);
}

/* ── Inline hint ──────────────────────────────────────────────────
   Replaces the bare <i>{{ $t(...) }}</i> pattern previously used
   under selected-option reveals (e.g. "Beneficial owners are
   collected in AML"). Reads as a quiet system note rather than
   page body text. */
.fatca-hint {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.6rem 0.85rem;
  background: #f0f7ff;
  border-left: 3px solid rgb(0, 73, 118);
  border-radius: 0 6px 6px 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #2d3748;
  font-style: italic;
}

.fatca-hint-icon {
  flex-shrink: 0;
  font-size: 0.95rem;
  margin-top: 0.1rem;
  color: rgb(0, 73, 118);
}
