/* TCS Incorporation Portal — shared styles (client + admin) */
:root {
  --navy: #13294b;
  --navy-2: #1d3a63;
  --navy-3: #2c4f82;
  --steel: #5a6b7e;
  --gold: #b9924c;
  --bg: #eef2f6;
  --card: #ffffff;
  --line: #d8e0e8;
  --line-2: #c3cfdb;
  --ink: #1c2b3a;
  --ok: #1e7e4d;
  --bad: #b3362c;
  --warn: #9a6700;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(19, 41, 75, .06), 0 8px 24px rgba(19, 41, 75, .07);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
a { color: var(--navy-3); }

/* ---------- header ---------- */
.site-header {
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-2) 70%, var(--navy-3) 100%);
  color: #fff;
  padding: 14px 0;
  border-bottom: 3px solid var(--gold);
}
.site-header .container { display: flex; align-items: center; gap: 14px; }
.logo-mark {
  width: 42px; height: 42px; border-radius: 9px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.35);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; letter-spacing: .5px; font-size: 15px; color: #fff;
}
.logo-text .org { font-weight: 650; font-size: 16.5px; letter-spacing: .2px; }
.logo-text .sub { font-size: 12px; color: #c7d3e2; margin-top: 1px; }
.header-nav { margin-left: auto; display: flex; gap: 16px; align-items: center; }
.header-nav a { color: #dbe6f3; text-decoration: none; font-size: 14px; }
.header-nav a:hover { color: #fff; }

.container { max-width: 1060px; margin: 0 auto; padding: 0 20px; }
main.container { padding-top: 28px; padding-bottom: 60px; }

/* ---------- generic card ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px 26px;
  margin-bottom: 22px;
}
.card h2 { margin: 0 0 6px; font-size: 19px; color: var(--navy); }
.card h3 { margin: 20px 0 8px; font-size: 15.5px; color: var(--navy-2); }
.muted { color: var(--steel); }
.small { font-size: 13px; }

/* ---------- landing ---------- */
.hero { padding: 36px 0 8px; }
.hero h1 { margin: 0 0 10px; font-size: 30px; color: var(--navy); line-height: 1.25; }
.hero p { max-width: 720px; color: var(--steel); margin: 0 0 8px; font-size: 16px; }
.steps { display: flex; gap: 14px; flex-wrap: wrap; margin: 22px 0 26px; }
.step {
  flex: 1 1 240px; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start;
  box-shadow: var(--shadow);
}
.step .n {
  background: var(--navy); color: #fff; min-width: 28px; height: 28px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 600; margin-top: 2px;
}
.step b { display: block; color: var(--navy); margin-bottom: 2px; }
.step span { font-size: 13.5px; color: var(--steel); }

.entity-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin: 10px 0 30px; }
.entity-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
  border-top: 4px solid var(--navy);
  transition: transform .12s ease, box-shadow .12s ease;
}
.entity-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(19,41,75,.14); }
.entity-card .flag { font-size: 12px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--gold); font-weight: 700; }
.entity-card h3 { margin: 0; font-size: 19px; color: var(--navy); }
.entity-card p { margin: 0; color: var(--steel); font-size: 14px; flex: 1; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--navy); color: #fff; border: 1px solid var(--navy);
  padding: 10px 18px; border-radius: 8px; font-size: 14.5px; font-weight: 600;
  cursor: pointer; text-decoration: none; transition: background .12s ease;
}
.btn:hover { background: var(--navy-2); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line-2); }
.btn.secondary:hover { background: #f3f6fa; }
.btn.danger { background: #fff; color: var(--bad); border-color: #e2b4af; }
.btn.danger:hover { background: #fdf3f2; }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 7px; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy-3); padding: 6px 8px; }
.btn.ghost:hover { background: #eef3f9; }

/* ---------- forms ---------- */
.form-title { margin: 8px 0 2px; font-size: 24px; color: var(--navy); }
.form-sub { color: var(--steel); margin: 0 0 18px; }
.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--navy); color: #fff; width: 26px; height: 26px; border-radius: 50%;
  font-size: 13.5px; font-weight: 700; margin-right: 9px; vertical-align: -5px;
}
.section-note {
  background: #f3f7fc; border: 1px solid #d7e4f2; border-left: 4px solid var(--navy-3);
  border-radius: 8px; padding: 9px 13px; font-size: 13.5px; color: #2d4257; margin: 10px 0 14px;
}
.fields-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin-top: 12px; }
.field.full { grid-column: 1 / -1; }
.field label.flabel { display: block; font-weight: 600; font-size: 13.5px; color: #2a3a4c; margin-bottom: 5px; }
.req { color: var(--bad); font-weight: 700; }
.help { font-size: 12.5px; color: var(--steel); margin: 3px 0 6px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="date"], input[type="number"],
input[type="password"], textarea, select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--line-2); border-radius: 8px;
  font: inherit; color: var(--ink); background: #fff; outline: none;
}
textarea { min-height: 64px; resize: vertical; }
input:focus, textarea:focus, select:focus { border-color: var(--navy-3); box-shadow: 0 0 0 3px rgba(44,79,130,.14); }
input.invalid, textarea.invalid, select.invalid, .radio-set.invalid, .date-parts.invalid {
  border-color: var(--bad);
  background: #fdf3f2;
  box-shadow: 0 0 0 3px rgba(179, 54, 44, .20);
}
.radio-set.invalid { border: 1px solid var(--bad); border-radius: 8px; padding: 8px; }
.date-parts.invalid { border: 1px solid var(--bad); border-radius: 8px; padding: 6px; }
.date-parts.invalid select { border-color: var(--bad); }
.decl-q.invalid, .decl-sub.invalid { background: #fdf3f2; box-shadow: 0 0 0 2px rgba(179, 54, 44, .22); border-radius: 8px; padding: 8px; }
.field-error {
  color: var(--bad); font-size: 12.5px; font-weight: 600; margin-top: 5px;
  display: flex; align-items: center; gap: 5px;
}
.field-error::before { content: "⚠"; font-size: 12px; }

/* DD/MM/YYYY date selects */
.date-parts { display: flex; gap: 8px; }
.date-parts select { width: auto; flex: 1 1 0; min-width: 0; }
.date-parts .date-y { flex: 0 0 92px; }
.radio-opt .specify-wrap .date-parts { max-width: 360px; }
.radio-opt { display: flex; align-items: flex-start; gap: 9px; padding: 5px 2px; font-size: 14px; }
.radio-opt input[type="radio"] { margin-top: 3px; accent-color: var(--navy); }
.radio-opt .specify-wrap { margin-top: 6px; }
.radio-opt .specify-wrap input { max-width: 420px; }

/* ---------- repeat / party cards ---------- */
.party-card {
  border: 1px solid var(--line); border-left: 4px solid var(--navy-3);
  border-radius: 9px; padding: 16px 18px; margin: 12px 0; background: #fbfdff;
}
.party-card.bo-card { border-left-color: var(--gold); background: #fffdf8; margin-left: 14px; }
.party-head { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.party-head .ttl { font-weight: 700; color: var(--navy); font-size: 14.5px; }
.party-head .spacer { flex: 1; }
.add-row { margin: 8px 0 4px; }

/* ---------- KYC upload blocks ---------- */
.kyc-block {
  margin-top: 14px; border: 1.5px dashed var(--line-2); border-radius: 9px;
  padding: 12px 14px; background: #f7fafc;
}
.kyc-block .kyc-title { font-weight: 700; font-size: 13px; color: var(--navy-2); letter-spacing: .3px; text-transform: uppercase; }
.doc-slot { padding: 9px 0 4px; border-bottom: 1px solid #e7edf3; }
.doc-slot:last-child { border-bottom: none; }
.doc-slot.invalid { background: #fdf3f1; border: 1px solid var(--bad); border-radius: 8px; padding: 9px 12px; margin: 4px 0; }
.doc-slot .doc-label { font-size: 13.5px; color: #2a3a4c; margin-bottom: 6px; }
.doc-slot input[type="file"] { display: none; }
.file-btn-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-chips { display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }
.file-chip {
  display: inline-flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--line);
  padding: 4px 10px; border-radius: 7px; font-size: 13px; max-width: 100%;
}
.file-chip .nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 420px; }
.file-chip .sz { color: var(--steel); font-size: 12px; white-space: nowrap; }
.file-chip button { background: none; border: none; color: var(--bad); font-size: 15px; cursor: pointer; padding: 0 2px; line-height: 1; }
.badge-req { font-size: 11px; font-weight: 700; color: var(--bad); border: 1px solid #e3b8b3; border-radius: 5px; padding: 1px 6px; margin-left: 7px; }
.badge-opt { font-size: 11px; font-weight: 600; color: var(--steel); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px; margin-left: 7px; }

/* ---------- alerts / errors ---------- */
.alert { border-radius: 9px; padding: 12px 16px; margin: 14px 0; font-size: 14px; }
.alert.error { background: #fdf2f1; border: 1px solid #ecc2bd; color: #8c2b23; }
.alert.success { background: #eef9f2; border: 1px solid #bfe3cd; color: #155c38; }
.alert.info { background: #eff5fc; border: 1px solid #cBDcf0; color: #234a6d; }
.alert.warn { background: #fff8e6; border: 1px solid #ecd9a0; color: #7a5b08; }
.alert ul { margin: 6px 0 0 18px; padding: 0; }

/* ---------- success panel ---------- */
.success-panel { text-align: center; padding: 50px 30px; }
.success-panel .tick {
  width: 64px; height: 64px; border-radius: 50%; background: var(--ok); color: #fff;
  font-size: 34px; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px;
}
.success-panel .ref { font-size: 22px; font-weight: 700; color: var(--navy); letter-spacing: .5px; }

/* ---------- tables (admin) ---------- */
table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th {
  text-align: left; background: var(--navy); color: #fff; padding: 9px 12px; font-weight: 600; font-size: 13px;
}
table.data th:first-child { border-radius: 8px 0 0 0; }
table.data th:last-child { border-radius: 0 8px 0 0; }
table.data td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data tr.rowlink { cursor: pointer; }
table.data tr.rowlink:hover td { background: #f3f7fb; }

.badge { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge.s-new { background: #e8f0fc; color: #1f4c8f; }
.badge.s-in-review { background: #fff4d6; color: #7a5b08; }
.badge.s-awaiting-documents { background: #fde8d7; color: #8a4a12; }
.badge.s-kyc-cleared { background: #e2f3ff; color: #105d86; }
.badge.s-completed { background: #e3f5ea; color: #166b3f; }
.badge.s-rejected { background: #fbe9e7; color: #8c2b23; }

/* ---------- admin misc ---------- */
.toolbar { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar input[type="text"], .toolbar select { width: auto; }
.kv { display: grid; grid-template-columns: 280px 1fr; gap: 6px 18px; font-size: 14px; }
.kv .k { color: var(--steel); }
.kv .v { font-weight: 500; white-space: pre-wrap; }
.subsec { font-weight: 700; color: var(--navy); margin: 16px 0 6px; font-size: 14px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.file-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; flex-wrap: wrap; }
.file-row .meta { color: var(--steel); font-size: 12.5px; }
.checkline { display: flex; gap: 9px; align-items: flex-start; padding: 4px 0; font-size: 13.5px; }
.checkline input { margin-top: 3px; accent-color: var(--navy); }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 27, 45, .55);
  display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; max-width: 560px; width: 100%;
  padding: 24px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.3); max-height: 85vh; overflow: auto;
}
.modal h3 { margin: 0 0 10px; color: var(--navy); }
.modal .btn-row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--steel); font-size: 13px; background: #fff; }

.hidden { display: none !important; }

details.cert { margin-top: 10px; }
details.cert summary { cursor: pointer; font-weight: 600; color: var(--navy-2); }
details.cert .certbox { background: #f7f9fb; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin-top: 8px; font-size: 13.5px; }

/* ---------- certification copy boxes + samples ---------- */
.cert-legend { font-weight: 600; color: var(--navy-2); margin: 4px 0 12px; font-size: 13.5px; }
.copybox { border: 1px solid var(--line-2); border-left: 4px solid var(--gold); border-radius: 8px; background: #fffdf6; padding: 10px 12px; margin: 10px 0; }
.copybox-title { font-weight: 600; font-size: 13px; color: var(--navy-2); margin-bottom: 6px; }
.copybox-row { display: flex; gap: 10px; align-items: flex-start; }
.copybox-text { flex: 1; font-size: 13px; font-style: italic; background: #fff; min-height: 40px; }
.copybox-hint { font-size: 12px; color: var(--steel); margin-top: 6px; }
.sample-row { display: flex; gap: 10px; flex-wrap: wrap; margin: 14px 0 10px; }
.modal-overlay.lightbox { flex-direction: column; gap: 10px; cursor: zoom-out; }
.modal-overlay.lightbox img { max-width: min(92vw, 680px); max-height: 86vh; background: #fff; border-radius: 10px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.lightbox-hint { color: #d6e2f0; font-size: 13px; }

/* ---------- info tooltip ---------- */
.tip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--navy-3); color: #fff; font-size: 11px; font-weight: 700;
  margin-left: 6px; cursor: help; position: relative; vertical-align: -2px; font-style: normal;
}
.tip::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: 130%; transform: translateX(-50%);
  width: 320px; max-width: 78vw;
  background: #1c2b3a; color: #f0f4f9; font-size: 12.5px; font-weight: 400; line-height: 1.45;
  padding: 10px 12px; border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.3);
  opacity: 0; pointer-events: none; transition: opacity .12s ease; z-index: 40;
  white-space: normal; text-align: left;
}
.tip:hover::after, .tip:focus::after { opacity: 1; }

/* ---------- individual declarations ---------- */
.decl-block {
  margin-top: 14px; border: 1.5px solid var(--line-2); border-radius: 9px;
  background: #fbfcfe; padding: 12px 14px;
}
.decl-block .decl-title { font-weight: 700; font-size: 13px; color: var(--navy-2); letter-spacing: .3px; text-transform: uppercase; }
.decl-master {
  display: flex; gap: 9px; align-items: flex-start; background: #eef7f0;
  border: 1px solid #bfe3cd; border-radius: 7px; padding: 9px 11px; margin: 10px 0; font-size: 13px; color: #155c38;
}
.decl-master input { margin-top: 2px; accent-color: var(--ok); }
.decl-section-title { font-weight: 600; color: var(--navy); font-size: 13.5px; margin: 14px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 4px; }
.decl-intro { font-size: 12.5px; color: var(--steel); margin: 4px 0 8px; }
.decl-q { display: flex; gap: 14px; align-items: flex-start; padding: 7px 0; border-bottom: 1px dashed #e3eaf1; }
.decl-q:last-child { border-bottom: none; }
.decl-q .q { flex: 1; font-size: 13px; color: #2a3a4c; }
.decl-q .yn { display: flex; gap: 14px; white-space: nowrap; font-size: 13px; }
.decl-q .yn label { display: flex; gap: 5px; align-items: center; }
.decl-q .yn input { accent-color: var(--navy); }
.decl-sub { padding: 7px 0; }
.decl-sub .flabel { display: block; font-weight: 600; font-size: 12.5px; color: #2a3a4c; margin-bottom: 4px; }
.multi-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; padding: 6px 0; }
.multi-grid label { display: flex; gap: 7px; align-items: center; font-size: 13px; }
.multi-grid input { accent-color: var(--navy); }

.doc-note { font-size: 12px; color: #8a4a12; margin: 4px 0 6px; }

/* contextual certification link + modal */
.linklike {
  background: none; border: none; padding: 0; margin: 2px 0 7px;
  color: var(--navy-3); font-size: 12.5px; font-weight: 600; cursor: pointer; text-decoration: underline;
}
.linklike:hover { color: var(--navy); }
.slot-cert { margin-top: 2px; }
.modal.cert-modal { max-width: 680px; }
.cert-sample-img {
  width: 100%; max-width: 420px; display: block; margin: 8px auto 0;
  border: 1px solid var(--line); border-radius: 8px; cursor: zoom-in; box-shadow: var(--shadow);
}
.slot-alt { margin-top: 4px; }
.slot-link { max-width: 460px; }
.slot-bio { max-width: 640px; min-height: 56px; }

.decl-bullets { margin: 4px 0 8px 4px; padding-left: 18px; }
.decl-bullets li { font-size: 12.5px; color: #33414f; margin: 3px 0; }

/* radio option description (e.g. payment-method surcharge) */
.opt-desc { display: block; font-size: 12.5px; color: var(--steel); margin-top: 2px; }
.opt-desc s { color: var(--bad); }
.opt-desc .disc { color: var(--ok); }
.opt-desc .lto {
  display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 20px;
  background: #fff4d6; color: #7a5b08; border: 1px solid #ecd9a0; font-size: 11px; font-weight: 700;
}

/* professional-director toggle */
.field.pro-toggle {
  background: #f3f7fc; border: 1px solid #d7e4f2; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 4px;
}
.party-card.pro-collapsed { background: #f7faf7; }

@media (max-width: 760px) {
  .fields-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
  .kv .k { margin-top: 8px; }
}

/* "Print / Save as PDF" of the preliminary outstanding-KYC list */
#printRoot { display: none; }
.print-doc h1 { font-size: 20px; color: var(--navy); margin: 0 0 6px; }
.print-doc .print-sub { font-weight: 600; color: var(--navy-2); margin: 0 0 10px; }
.print-doc .print-note { color: var(--steel); font-size: 12px; margin: 0 0 16px; }
.print-doc .print-party { font-size: 14px; color: var(--navy); margin: 14px 0 4px; border-bottom: 1px solid var(--line); padding-bottom: 3px; }
.print-doc .print-docs { margin: 0 0 6px 18px; padding: 0; }
.print-doc .print-docs li { margin: 3px 0; }
.print-doc .print-ok { color: #155c38; font-weight: 600; }
.print-doc .print-footer { margin-top: 22px; color: var(--steel); font-size: 11px; }

@media print {
  body.printing-outstanding > *:not(#printRoot) { display: none !important; }
  body.printing-outstanding #printRoot { display: block !important; }
  body.printing-outstanding { background: #fff; }
}
