/* =========================================================================
   CGS Property Timeline - full-screen tool page styles
   Brand: Navy #13203C, Gold #B8902E, Ivory #F6F1E6
   ========================================================================= */

/* ---- Fonts (bundled locally; Malayalam shaping needs a real font) ---- */
@font-face { font-family: "CGS Inter"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/inter-400.woff2") format("woff2"); }
@font-face { font-family: "CGS Inter"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/inter-600.woff2") format("woff2"); }
@font-face { font-family: "CGS Inter"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/inter-700.woff2") format("woff2"); }
@font-face { font-family: "CGS Noto ML"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/noto-ml-400.woff2") format("woff2"); }
@font-face { font-family: "CGS Noto ML"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/noto-ml-700.woff2") format("woff2"); }

:root {
	--navy: #13203C;
	--navy-2: #1d2f55;
	--gold: #B8902E;
	--gold-2: #d4aa4a;
	--ivory: #F6F1E6;
	--ink: #1b2233;
	--muted: #6b7388;
	--line: #e1d9c6;
	--ok: #1f8a4c;
	--err: #b3261e;
	--radius: 12px;
	--font: "CGS Inter", "CGS Noto ML", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body.cgspt {
	font-family: var(--font);
	color: var(--ink);
	background: var(--ivory);
	line-height: 1.5;
	-webkit-text-size-adjust: 100%;
}

/* ---- Header / hero ---- */
.cgspt-header {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 18px; background: var(--navy); color: #fff;
	border-bottom: 3px solid var(--gold);
	position: sticky; top: 0; z-index: 1000;
}
.cgspt-header__brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.cgspt-header__icon {
	width: 40px; height: 40px; border-radius: 50%; background: var(--gold);
	display: grid; place-items: center; font-size: 22px; flex: 0 0 auto;
}
.cgspt-header__name { font-weight: 700; font-size: 16px; line-height: 1.2; }
.cgspt-header__badge { font-size: 12px; color: var(--gold-2); letter-spacing: .04em; }

.cgspt-hero { padding: 18px 18px 6px; max-width: 1400px; margin: 0 auto; }
.cgspt-hero h1 { margin: 0 0 4px; font-size: 26px; color: var(--navy); }
.cgspt-hero p { margin: 0; color: var(--muted); font-size: 14px; }

/* ---- Layout ---- */
.cgspt-main {
	display: grid; grid-template-columns: 390px minmax(0, 1fr);
	gap: 16px; padding: 14px 18px 20px; max-width: 1400px; margin: 0 auto;
}
.cgspt-side { display: flex; flex-direction: column; gap: 14px; }
.cgspt-stage { min-width: 0; }

.cgspt-card {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	padding: 14px; box-shadow: 0 1px 2px rgba(19,32,60,.06);
}
.cgspt-card h2 {
	margin: 0 0 10px; font-size: 16px; color: var(--navy);
	display: flex; align-items: center; gap: 10px;
}
.cgspt-step {
	width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: var(--gold-2);
	display: inline-grid; place-items: center; font-size: 13px; font-weight: 700; flex: 0 0 auto;
}
.cgspt-hint { margin: 8px 0; font-size: 12.5px; color: var(--muted); }

/* ---- Controls ---- */
.cgspt-row { display: flex; gap: 8px; align-items: center; }
.cgspt-row--wrap { flex-wrap: wrap; margin-top: 8px; }
.cgspt input[type=text], .cgspt textarea {
	width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px;
	font: inherit; font-size: 14px; background: #fff; color: var(--ink);
}
.cgspt input[type=text]:focus, .cgspt textarea:focus {
	outline: 2px solid var(--gold-2); outline-offset: 0; border-color: var(--gold);
}
.cgspt-field { display: block; margin-bottom: 10px; }
.cgspt-field > span { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 3px; }

.cgspt-btn {
	font: inherit; font-size: 13.5px; font-weight: 600; padding: 9px 14px; border-radius: 8px;
	border: 1px solid transparent; cursor: pointer; white-space: nowrap; text-decoration: none;
	display: inline-flex; align-items: center; justify-content: center; line-height: 1.2;
	transition: transform .05s ease, background .15s ease;
}
.cgspt-btn:active { transform: translateY(1px); }
.cgspt-btn[disabled] { opacity: .45; cursor: not-allowed; }
.cgspt-btn--navy { background: var(--navy); color: #fff; }
.cgspt-btn--navy:hover:not([disabled]) { background: var(--navy-2); }
.cgspt-btn--gold { background: var(--gold); color: #fff; }
.cgspt-btn--gold:hover:not([disabled]) { background: #a07d26; }
.cgspt-btn--ghost { background: #fff; color: var(--navy); border-color: var(--line); }
.cgspt-btn--ghost:hover:not([disabled]) { background: var(--ivory); }
.cgspt-header .cgspt-btn--ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.cgspt-btn--block { width: 100%; padding: 12px; font-size: 15px; }
.cgspt-btn.is-on { background: var(--gold); color: #fff; border-color: var(--gold); }

.cgspt-results { list-style: none; margin: 8px 0 0; padding: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.cgspt-results li { padding: 9px 11px; font-size: 13px; cursor: pointer; border-bottom: 1px solid var(--line); }
.cgspt-results li:last-child { border-bottom: 0; }
.cgspt-results li:hover { background: var(--ivory); }

.cgspt-area {
	margin-top: 10px; padding: 10px 12px; background: var(--ivory); border-left: 4px solid var(--gold);
	border-radius: 6px; font-size: 13px;
}
.cgspt-area b { color: var(--navy); }

.cgspt-status { margin-top: 10px; font-size: 13px; color: var(--navy); }
.cgspt-status.is-err { color: var(--err); }
.cgspt-status.is-ok { color: var(--ok); }

/* ---- Date list ---- */
.cgspt-dates { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 340px; overflow: auto; }
.cgspt-dates li {
	display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border: 1px solid var(--line);
	border-radius: 8px; cursor: pointer; background: #fff;
}
.cgspt-dates li:hover { background: var(--ivory); }
.cgspt-dates li.is-sel { border-color: var(--gold); background: #fbf6e8; box-shadow: inset 0 0 0 1px var(--gold); }
.cgspt-dates input { margin-top: 4px; accent-color: var(--gold); }
.cgspt-dates .d-main { font-weight: 700; font-size: 14px; color: var(--navy); }
.cgspt-dates .d-sub { font-size: 12px; color: var(--muted); }

/* ---- Stage / tabs ---- */
.cgspt-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.cgspt-tab {
	font: inherit; font-weight: 600; font-size: 14px; padding: 8px 18px; border-radius: 8px 8px 0 0;
	border: 1px solid var(--line); border-bottom: 0; background: #ece5d3; color: var(--muted); cursor: pointer;
}
.cgspt-tab.is-active { background: var(--navy); color: #fff; border-color: var(--navy); }
.cgspt-tab[disabled] { opacity: .5; cursor: not-allowed; }

.cgspt-view { position: relative; }
.cgspt-map { height: calc(100vh - 230px); min-height: 440px; border-radius: var(--radius); border: 1px solid var(--navy); background: #0d1526; }
.cgspt-badge-live {
	position: absolute; left: 10px; bottom: 10px; z-index: 500; background: rgba(19,32,60,.88); color: #fff;
	padding: 5px 10px; font-size: 12px; border-radius: 6px; pointer-events: none; max-width: 80%;
}
.cgspt-badge-live:empty { display: none; }

/* ---- Compare grid ---- */
.cgspt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cgspt-panel { background: #fff; border: 1px solid var(--navy); border-radius: var(--radius); overflow: hidden; }
.cgspt-panel__head { background: var(--navy); color: #fff; padding: 7px 10px; font-size: 13px; }
.cgspt-panel__head b { color: var(--gold-2); font-size: 14px; }
.cgspt-panel__head small { display: block; color: #c7cfe2; font-size: 11.5px; }
.cgspt-panel__map { width: 100%; aspect-ratio: 4 / 3; background: #0d1526; }

/* ---- Leaflet overrides ---- */
.leaflet-container { font-family: var(--font); }
.cgspt-pin { background: transparent; border: 0; }
.cgspt-pin span {
	display: block; width: 26px; height: 26px; margin: -26px 0 0 -13px; background: var(--gold);
	border: 3px solid #fff; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
	box-shadow: 0 2px 6px rgba(0,0,0,.5);
}
.cgspt-pin span::after { content: ""; position: absolute; width: 8px; height: 8px; background: #fff; border-radius: 50%; top: 6px; left: 6px; }
.cgspt-vertex { background: #fff; border: 3px solid #ff3b30; border-radius: 50%; }

/* ---- Footer ---- */
.cgspt-footer {
	background: var(--navy); color: #cfd6e8; padding: 16px 18px; font-size: 12.5px; text-align: center;
	border-top: 3px solid var(--gold);
}
.cgspt-footer__contact { margin-top: 4px; color: var(--gold-2); }
.cgspt-footer__credit { margin-top: 6px; font-size: 11.5px; color: #98a3c0; }

/* ---- Login gate ---- */
.cgspt-gate { min-height: 100vh; display: grid; place-items: center; background: var(--navy); padding: 20px; }
.cgspt-gate__card { background: var(--ivory); padding: 34px 28px; border-radius: 16px; text-align: center; max-width: 380px; border-top: 5px solid var(--gold); }
.cgspt-gate__icon { font-size: 40px; }
.cgspt-gate h1 { color: var(--navy); margin: 8px 0; font-size: 22px; }

/* ---- Offscreen PDF pages (A4 @ 96dpi = 794 x 1123) ---- */
#cgspt-pdf-stage { position: fixed; left: -12000px; top: 0; width: 794px; z-index: -1; }
.rp-page {
	width: 794px; height: 1123px; background: #fff; position: relative; overflow: hidden;
	font-family: "CGS Inter", "CGS Noto ML", sans-serif; color: #1b2233; font-size: 12px; line-height: 1.45;
}
.rp-band { background: #13203C; color: #fff; height: 96px; padding: 0 40px; display: flex; align-items: center; justify-content: space-between; border-bottom: 4px solid #B8902E; }
.rp-band__brand { display: flex; align-items: center; gap: 14px; }
.rp-band__icon { width: 46px; height: 46px; border-radius: 50%; background: #B8902E; display: grid; place-items: center; font-size: 26px; }
.rp-band__name { font-size: 18px; font-weight: 700; }
.rp-band__tag { font-size: 11px; color: #d4aa4a; letter-spacing: .06em; }
.rp-band__meta { text-align: right; font-size: 10.5px; color: #c7cfe2; line-height: 1.6; }
.rp-band__meta b { color: #fff; }
.rp-body { padding: 20px 40px 0; }
.rp-title { font-size: 25px; font-weight: 700; color: #13203C; margin: 0; line-height: 1.2; }
.rp-title-ml { font-size: 16px; color: #B8902E; font-weight: 700; margin-top: 3px; }
.rp-rule { height: 3px; width: 70px; background: #B8902E; margin: 10px 0 14px; }
.rp-h2 { font-size: 15px; font-weight: 700; color: #13203C; margin: 0 0 8px; padding-bottom: 5px; border-bottom: 1px solid #e1d9c6; }
.rp-h2 small { font-size: 11.5px; font-weight: 700; color: #B8902E; margin-left: 8px; }
.rp-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.rp-table th, .rp-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid #ece5d3; vertical-align: top; }
.rp-table th { background: #F6F1E6; color: #13203C; font-weight: 600; width: 190px; }
.rp-table--grid th { width: auto; background: #13203C; color: #fff; }
.rp-table small { color: #B8902E; font-weight: 600; display: block; font-size: 10px; }
.rp-img { display: block; width: 100%; border: 1px solid #13203C; }
.rp-cap { font-size: 10.5px; color: #6b7388; margin-top: 4px; }
.rp-cells { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; }
.rp-cell__head { background: #13203C; color: #fff; padding: 6px 9px; font-size: 11px; }
.rp-cell__head b { color: #d4aa4a; font-size: 13px; }
.rp-cell img { display: block; width: 100%; }
.rp-cell { border: 1px solid #13203C; }
.rp-note { background: #F6F1E6; border-left: 4px solid #B8902E; padding: 9px 12px; font-size: 11px; margin-top: 12px; white-space: pre-wrap; }
.rp-foot { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; background: #13203C; color: #cfd6e8; padding: 8px 40px; font-size: 9.5px; display: flex; justify-content: space-between; align-items: center; border-top: 3px solid #B8902E; }
.rp-foot b { color: #d4aa4a; }
.rp-timeline { display: flex; justify-content: space-between; margin: 12px 0 0; position: relative; }
.rp-timeline::before { content: ""; position: absolute; left: 20px; right: 20px; top: 9px; height: 3px; background: #B8902E; }
.rp-tl { position: relative; text-align: center; flex: 1; font-size: 10.5px; }
.rp-tl i { display: block; width: 20px; height: 20px; border-radius: 50%; background: #13203C; border: 4px solid #B8902E; margin: 0 auto 5px; }
.rp-tl b { display: block; color: #13203C; font-size: 11.5px; }
.rp-sign { display: flex; gap: 40px; margin-top: 34px; }
.rp-sign div { flex: 1; border-top: 1px solid #13203C; padding-top: 4px; font-size: 10.5px; color: #6b7388; }

/* ---- Responsive ---- */
@media (max-width: 960px) {
	.cgspt-main { grid-template-columns: 1fr; padding: 10px 12px 16px; }
	.cgspt-stage { order: -1; }
	.cgspt-map { height: 58vh; min-height: 320px; }
	.cgspt-hero h1 { font-size: 22px; }
	.cgspt-grid { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
	.cgspt-header { padding: 8px 12px; }
	.cgspt-header__name { font-size: 14px; }
	.cgspt-hero { padding: 12px 12px 2px; }
}
