/* EasyMarketConnects hub — one small stylesheet, no framework (NFR-01, NFR-03). */

:root {
	--primary: #0f6b4f;          /* trust green */
	--primary-hover: #0b5640;
	--primary-soft: #e3f3ec;
	--accent: #f59e0b;           /* saffron */
	--accent-ink: #3b2400;
	--bg: #ffffff;
	--bg-alt: #f6f7f5;
	--surface: #ffffff;
	--text: #1c2421;
	--muted: #56605c;
	--border: #e2e6e3;
	--shadow: 0 1px 2px rgba(16, 24, 20, .06), 0 4px 16px rgba(16, 24, 20, .06);
	--shadow-hover: 0 4px 10px rgba(16, 24, 20, .08), 0 14px 32px rgba(16, 24, 20, .10);
	--radius: 14px;
	--radius-sm: 8px;
	--focus: 0 0 0 3px var(--bg), 0 0 0 5px #2563eb;
	--font: "Inter", "Poppins", "Noto Sans Devanagari", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--brand: var(--primary);
	--brand-ink: #ffffff;
	color-scheme: light;
}

[data-theme="dark"] {
	--primary: #34c08f;
	--primary-hover: #5bd3a8;
	--primary-soft: #133328;
	--accent: #fbbf24;
	--bg: #0f1412;
	--bg-alt: #151c19;
	--surface: #1a2320;
	--text: #e8eeeb;
	--muted: #a3b0aa;
	--border: #2a3531;
	--shadow: 0 1px 2px rgba(0, 0, 0, .4);
	--shadow-hover: 0 8px 28px rgba(0, 0, 0, .45);
	--focus: 0 0 0 3px var(--bg), 0 0 0 5px #60a5fa;
	--brand-ink: #04130d;
	color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
	margin: 0;
	font: 16px/1.6 var(--font);
	color: var(--text);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary); text-underline-offset: 3px; }
a:hover { color: var(--primary-hover); }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); font-weight: 750; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 20px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.center { text-align: center; }
.muted { color: var(--muted); }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 46rem; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* ------------------------------------------------------------------ buttons */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: .4em;
	min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 1px solid transparent;
	font: 600 .95rem/1.2 var(--font); text-decoration: none; cursor: pointer;
	transition: background .15s, transform .15s, box-shadow .15s, color .15s;
}
.btn:active { transform: translateY(1px); }
.btn-lg { min-height: 50px; padding: 12px 24px; font-size: 1.02rem; }
.btn-sm { min-height: 36px; padding: 6px 12px; font-size: .88rem; }
.btn-primary { background: var(--primary); color: #fff; }
[data-theme="dark"] .btn-primary { color: #04130d; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
[data-theme="dark"] .btn-primary:hover { color: #04130d; }
.btn-accent { background: var(--accent); color: var(--accent-ink); }
.btn-accent:hover { filter: brightness(1.06); color: var(--accent-ink); }
.btn-ghost { background: rgba(255, 255, 255, .14); color: inherit; border-color: currentColor; }
.btn-outline { background: transparent; color: var(--text); border-color: var(--border); }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-brand { background: var(--brand); color: var(--brand-ink); width: 100%; }
.btn-brand:hover { color: var(--brand-ink); filter: brightness(.92); }
.icon-btn {
	display: inline-grid; place-items: center; width: 44px; height: 44px; border-radius: 10px;
	border: 1px solid var(--border); background: var(--surface); color: var(--text); cursor: pointer; font-size: 1.1rem;
}
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }

/* ------------------------------------------------------------------ header */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: color-mix(in srgb, var(--bg) 88%, transparent);
	backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
	border-bottom: 1px solid var(--border);
}
.header-inner { display: flex; align-items: center; gap: 12px; min-height: 66px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; margin-right: auto; }
.brand img { border-radius: 10px; }
.site-nav { display: flex; gap: 4px; }
.site-nav a { padding: 10px 14px; border-radius: 10px; color: var(--text); text-decoration: none; font-weight: 600; font-size: .96rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary); }
.menu-toggle { display: none; order: 3; }
.theme-toggle .i-moon { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-moon { display: block; }
@media (max-width: 767px) {
	.menu-toggle { display: inline-grid; }
	.site-nav {
		display: none; position: absolute; left: 0; right: 0; top: 66px; flex-direction: column;
		padding: 10px 16px 16px; background: var(--bg); border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
	}
	.site-nav.open { display: flex; }
	.site-nav a { padding: 14px; }
}

/* ------------------------------------------------------------------ hero */
.hero { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--primary-soft), var(--bg) 70%); padding: clamp(48px, 9vw, 110px) 0 clamp(40px, 7vw, 84px); }
.hero.has-image { color: #fff; background: #0c2a20; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.has-image::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 20, 14, .82), rgba(5, 20, 14, .45)); }
.hero-inner { position: relative; z-index: 1; max-width: 1360px; }
.hero h1 { max-width: 18ch; }
.hero .lead { color: inherit; opacity: .9; }
.hero:not(.has-image) .lead { color: var(--muted); opacity: 1; }
.hero:not(.has-image) .btn-ghost { color: var(--primary); }
.hero-search { display: flex; gap: 8px; max-width: 560px; margin: 24px 0 18px; padding: 6px; background: var(--surface); border-radius: 14px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 10px 12px; font: inherit; color: var(--text); }
.hero-search input:focus { outline: none; }
.hero-search:focus-within { box-shadow: var(--focus); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ------------------------------------------------------------------ counters */
.counters { border-bottom: 1px solid var(--border); background: var(--surface); }
.counters-inner { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; padding-top: 22px; padding-bottom: 22px; }
.counter { display: flex; flex-direction: column; align-items: center; text-align: center; }
.counter-value { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--primary); }
.counter-label { color: var(--muted); font-size: .92rem; }

/* ------------------------------------------------------------------ sections */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section-tight { padding-top: 24px; }
.section-alt { background: var(--bg-alt); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; }
.link-more { font-weight: 600; text-decoration: none; }
.page-head { padding: clamp(32px, 5vw, 56px) 0 8px; background: linear-gradient(180deg, var(--primary-soft), var(--bg)); }
.cat-group { margin-top: 32px; }
.cat-group[hidden] { display: none; }
.cat-title { font-size: 1.3rem; margin-bottom: 4px; }
.cat-desc { color: var(--muted); margin-bottom: 14px; }
.divider { border: 0; border-top: 1px solid var(--border); margin: 0; }

/* ------------------------------------------------------------------ grid + cards */
.grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1440px) { .grid { grid-template-columns: repeat(4, 1fr); } .grid-featured { grid-template-columns: repeat(3, 1fr); } }
.preview-grid { max-width: 420px; grid-template-columns: 1fr !important; }

.card {
	position: relative; display: flex; flex-direction: column;
	background: var(--surface); border: 1px solid var(--border); border-top: 4px solid var(--brand);
	border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease;
}
.card[hidden] { display: none; }
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card:has(.card-link:focus-visible) { box-shadow: var(--focus), var(--shadow-hover); }
.card-cover { position: relative; aspect-ratio: 16 / 9; background: linear-gradient(110deg, var(--bg-alt) 30%, var(--border) 50%, var(--bg-alt) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s infinite linear; }
.card-cover > img:first-child { width: 100%; height: 100%; object-fit: cover; }
@keyframes shimmer { to { background-position: -150% 0; } }
.card-logo {
	position: absolute; left: 16px; bottom: -32px; width: 64px; height: 64px; border-radius: 50%;
	object-fit: cover; background: var(--surface); border: 3px solid var(--surface); box-shadow: var(--shadow);
}
.card-badge {
	position: absolute; top: 12px; right: 12px; padding: 3px 10px; border-radius: 999px;
	background: var(--accent); color: var(--accent-ink); font-size: .78rem; font-weight: 700;
}
.card-body { padding: 42px 16px 8px; flex: 1; }
.card-title { font-size: 1.12rem; margin-bottom: 4px; }
.card-link { color: var(--text); text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { box-shadow: none; }
.card-tagline {
	color: var(--muted); font-size: .94rem; margin-bottom: 12px;
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3em;
}
.card-meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.card-actions { padding: 8px 16px 16px; position: relative; z-index: 2; }
.chip-sm { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--border); font-size: .8rem; font-weight: 600; color: var(--muted); }
.chip-badge { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 600; color: var(--muted); }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status-live { color: #13795b; }
.status-beta { color: #1d5fc4; }
.status-soon { color: #a15c00; }
.status-maint { color: #b42318; }
[data-theme="dark"] .status-live { color: #4ade80; }
[data-theme="dark"] .status-beta { color: #7cb3ff; }
[data-theme="dark"] .status-soon { color: #fbbf24; }
[data-theme="dark"] .status-maint { color: #f87171; }

/* ------------------------------------------------------------------ filters */
.filter-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 16px; }
.search { flex: 1 1 280px; display: flex; align-items: center; gap: 8px; padding: 0 14px; min-height: 48px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--muted); }
.search:focus-within { box-shadow: var(--focus); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; color: var(--text); padding: 10px 0; }
.search input:focus { outline: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px; scrollbar-width: thin; flex: 1 1 100%; order: 3; }
.chip { flex: none; min-height: 40px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: 600 .9rem var(--font); cursor: pointer; white-space: nowrap; }
.chip:hover { border-color: var(--primary); }
.chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: #fff; }
[data-theme="dark"] .chip[aria-pressed="true"] { color: #04130d; }
.sort { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.sort select { min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text); font: inherit; }
.result-count { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.empty { text-align: center; padding: 48px 16px; border: 2px dashed var(--border); border-radius: var(--radius); }
.empty[hidden] { display: none; }
.empty-title { font-size: 1.15rem; font-weight: 700; }

/* ------------------------------------------------------------------ how it works */
.steps { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 20px; grid-template-columns: 1fr; counter-reset: s; }
@media (min-width: 768px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { padding: 24px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
.step-num { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 800; margin-bottom: 12px; }
.step p { color: var(--muted); margin: 0; }

/* ------------------------------------------------------------------ testimonials */
.slider { position: relative; max-width: 760px; margin: 20px auto 0; }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; gap: 16px; }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; margin: 0; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.slide blockquote { margin: 0 0 16px; font-size: 1.15rem; }
.slide figcaption { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.slide figcaption img { border-radius: 50%; width: 48px; height: 48px; object-fit: cover; }
.slide figcaption b { color: var(--text); }
.slider-nav { display: flex; justify-content: center; gap: 10px; margin-top: 14px; }

/* ------------------------------------------------------------------ CTA + forms */
.cta { display: grid; gap: 20px; align-items: center; padding: clamp(24px, 4vw, 44px); border-radius: 20px; background: var(--primary-soft); border: 1px solid var(--border); }
@media (min-width: 900px) { .cta { grid-template-columns: 1.1fr 1fr; } }
.cta p { color: var(--muted); margin: 0; }
.subscribe-row { display: flex; gap: 8px; }
.subscribe input[type="email"], .field input, .field select, .field textarea {
	width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border);
	background: var(--surface); color: var(--text); font: inherit;
}
.subscribe input[type="email"] { flex: 1; min-width: 0; }
.subscribe input:focus, .field input:focus, .field select:focus, .field textarea:focus { outline: none; box-shadow: var(--focus); }
.consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: .86rem; color: var(--muted); }
.consent input { margin-top: 4px; width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.form-msg { margin: 10px 0 0; font-weight: 600; min-height: 1.2em; }
.form-msg.ok { color: var(--primary); }
.form-msg.err { color: #c0362c; }
[data-theme="dark"] .form-msg.err { color: #f87171; }
.form-card { padding: clamp(20px, 3vw, 32px); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: .94rem; }
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 640px) { .field-row { grid-template-columns: 1fr 1fr; } }
.captcha input { max-width: 120px; }
.contact-grid { display: grid; gap: 28px; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: 1.6fr 1fr; } }
.contact-aside h2 { font-size: 1.2rem; }

/* ------------------------------------------------------------------ portal detail */
.detail-cover { max-width: 1360px; margin: 0 auto; aspect-ratio: 16 / 9; max-height: 440px; overflow: hidden; background: var(--bg-alt); }
@media (min-width: 1360px) { .detail-cover { border-radius: 0 0 20px 20px; } }
.detail-cover img { width: 100%; height: 100%; object-fit: cover; }
.detail-head { display: grid; gap: 16px; grid-template-columns: auto 1fr; align-items: start; margin-top: -48px; position: relative; }
.detail-logo { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; border: 4px solid var(--bg); background: var(--surface); box-shadow: var(--shadow); }
.detail-title { padding-top: 56px; }
.detail-title .lead { margin-bottom: 10px; }
.detail-cta { grid-column: 1 / -1; }
.detail-cta .btn { width: auto; }
@media (min-width: 900px) { .detail-head { grid-template-columns: auto 1fr auto; } .detail-cta { grid-column: auto; padding-top: 64px; } }
.crumbs { font-size: .88rem; color: var(--muted); margin-bottom: 6px; }
.detail-body { display: grid; gap: 36px; padding-top: 28px; padding-bottom: 56px; max-width: 960px; margin-left: 0; }
@media (min-width: 1360px) { .detail-body { margin-left: calc((100vw - 1360px) / 2); } }
.prose { font-size: 1.05rem; }
.prose img { border-radius: var(--radius-sm); }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .features { grid-template-columns: 1fr 1fr; } }
.features li { display: flex; gap: 14px; padding: 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.features h3 { font-size: 1.02rem; margin-bottom: 4px; }
.features p { color: var(--muted); margin: 0; font-size: .95rem; }
.feat-icon { flex: none; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--primary-soft); font-size: 1.3rem; }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.gallery figure { margin: 0; }
.gallery img { border-radius: var(--radius-sm); border: 1px solid var(--border); }
.gallery figcaption { color: var(--muted); font-size: .88rem; margin-top: 6px; }
.share { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.share-h { font-size: 1rem; margin: 0 8px 0 0; }
.preview-bar { background: var(--accent); color: var(--accent-ink); padding: 10px 0; }
.preview-bar a { color: var(--accent-ink); font-weight: 700; margin-left: 8px; }

/* Frappe Web Pages (About, Privacy, Terms) rendered inside the hub layout */
.page-content-wrapper, .web-page-content, .page_content { max-width: 820px; margin: 0 auto; padding: 40px 20px 64px; font-size: 1.05rem; }
.page-content-wrapper .container { max-width: none; padding: 0; }
.page-header h1 { margin-bottom: .6em; }
.page-breadcrumbs, .web-sidebar { display: none; }

/* ------------------------------------------------------------------ footer */
.site-footer { background: var(--bg-alt); border-top: 1px solid var(--border); padding-top: 48px; color: var(--muted); font-size: .95rem; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .footer-grid { grid-template-columns: 1.4fr repeat(3, 1fr) 1.5fr; } }
.footer-grid ul { list-style: none; padding: 0; margin: 0; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text); text-decoration: none; }
.footer-grid a:hover { color: var(--primary); text-decoration: underline; }
.footer-about .brand { margin-bottom: 8px; }
.footer-h { font-size: .95rem; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.social { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 28px; margin-top: 32px; border-top: 1px solid var(--border); }
.footer-bottom nav { display: flex; gap: 16px; flex-wrap: wrap; }
.footer-bottom a { color: var(--muted); }

/* ------------------------------------------------------------------ dialog + toast */
.notify-dialog { border: 0; border-radius: 18px; padding: 0; width: min(440px, calc(100vw - 32px)); background: var(--surface); color: var(--text); box-shadow: var(--shadow-hover); }
.notify-dialog::backdrop { background: rgba(5, 15, 10, .55); }
.notify-inner { padding: 24px; }
.notify-inner h2 { font-size: 1.3rem; padding-right: 40px; }
.notify-close { position: absolute; top: 12px; right: 12px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 12px; font-weight: 600; z-index: 200; box-shadow: var(--shadow-hover); }
