/**
 * SolarTrack — Landing page (single-page portal)
 * Mobile-first, responsive, works with hub theme variables.
 */

html { scroll-behavior: smooth; }

/* ---- Skip link (SEO & a11y: first focusable, visible on focus) ---- */
.lp-skip-link {
    position: absolute;
    left: -9999px;
    top: 8px;
    z-index: 9999;
    padding: 12px 20px;
    background: var(--hub-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--hub-radius-sm);
}
.lp-skip-link:focus {
    left: 12px;
    outline: 2px solid var(--hub-primary);
    outline-offset: 2px;
}

/* ---- Page wrapper ---- */
.lp-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--hub-bg);
    color: var(--hub-text);
}

/* ---- Container (Spoorthy concept) ---- */
.lp-container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---- Top Bar (Spoorthy concept) ---- */
.lp-top-bar {
    background: var(--hub-sidebar-bg, #1a1a2e);
    color: rgba(255,255,255,0.85);
    font-size: 0.82rem;
    padding: 6px 0 0;
}
.lp-top-bar .lp-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
}
.lp-top-bar a { color: rgba(255,255,255,0.85); text-decoration: none; }
.lp-top-bar a:hover { color: var(--hub-primary, #e65100); }
.lp-top-bar-left {
    display: flex;
    gap: 16px;
    align-items: center;
    padding-bottom: 8px;
}
.lp-top-bar-right { display: flex; gap: 6px; align-items: flex-end; }
.lp-top-bar-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 10px 10px 0 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: rgba(255,255,255,0.75);
    border: 1px solid rgba(255,255,255,0.12);
    border-bottom: none;
    text-decoration: none;
    transition: all 0.2s ease;
}
.lp-top-bar-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
.lp-top-bar-btn-active {
    background: var(--hub-surface, #fff);
    color: var(--hub-primary) !important;
    border-color: var(--hub-border);
    font-weight: 700;
}
.lp-top-bar-btn .lp-short-label { display: none; }
.lp-top-bar-btn .lp-full-label { display: inline; }
.lp-theme-toggle {
    background: none;
    border: 1.5px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: rgba(255,255,255,0.8);
    font-size: 1rem;
    padding: 0;
}
.lp-theme-toggle .icon-sun, .lp-theme-toggle .icon-moon { display: none; }
.lp-theme-toggle .icon-moon { display: inline; }
[data-theme="dark"] .lp-theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .lp-theme-toggle .icon-sun { display: inline; }

/* ---- Navbar (Spoorthy concept) ---- */
.lp-navbar {
    background: var(--hub-surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.08);
    position: sticky;
    top: 0;
    z-index: 100;
}
.lp-navbar .lp-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    padding-bottom: 12px;
}
.lp-navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: inherit;
}
.lp-navbar-brand img { height: 44px; width: auto; }
.lp-navbar-badge {
    background: var(--hub-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 4px;
    letter-spacing: 0.5px;
}
.lp-nav-links { display: flex; gap: 6px; align-items: center; }
.lp-nav-link {
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--hub-text-muted);
    text-decoration: none;
    border-radius: var(--hub-radius-sm);
    transition: all 0.2s;
}
.lp-nav-link:hover { color: var(--hub-primary); background: rgba(230,81,0,.06); }
.lp-btn-nav {
    padding: 10px 22px;
    background: var(--hub-primary);
    color: #fff !important;
    border: none;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: inherit;
    margin-left: 8px;
    transition: all 0.2s;
}
.lp-btn-nav:hover { background: var(--hub-primary-dark); transform: translateY(-1px); }
.lp-btn-nav-link { text-decoration: none; color: #fff !important; }
.lp-btn-nav-link:hover { color: #fff !important; text-decoration: none; }
.lp-nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    flex-direction: column;
    gap: 5px;
}
.lp-nav-toggle span { display: block; width: 26px; height: 2px; background: var(--hub-text); border-radius: 2px; }

@media (max-width: 768px) {
    .lp-nav-links { display: none; }
    .lp-nav-links.is-open { display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0; background: var(--hub-surface); padding: 16px; box-shadow: 0 4px 12px rgba(0,0,0,.1); gap: 4px; }
    .lp-nav-link { width: 100%; padding: 12px 16px; }
    .lp-btn-nav { margin-left: 0; margin-top: 8px; width: 100%; justify-content: center; }
    .lp-nav-toggle { display: flex; }
    .lp-top-bar-left { justify-content: center; }
    .lp-top-bar-right { justify-content: center; width: 100%; }
    .lp-top-bar-btn .lp-full-label { display: none; }
    .lp-top-bar-btn .lp-short-label { display: inline; }
    .lp-top-bar-btn { font-size: 0.7rem; padding: 5px 10px; }
}

/* ---- Footer (Spoorthy concept) ---- */
.lp-footer {
    margin-top: auto;
    background: var(--hub-sidebar-bg, #1a1a2e);
    color: rgba(255,255,255,0.9);
    padding: 48px 0 0;
}
.lp-footer a { color: rgba(255,255,255,0.85); text-decoration: none; }
.lp-footer a:hover { color: var(--hub-primary, #e65100); }
.lp-footer .lp-container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.lp-footer-grid {
    display: grid;
    gap: 32px;
    padding-bottom: 32px;
}
@media (min-width: 768px) { .lp-footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .lp-footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; } }
.lp-footer-brand { margin-bottom: 8px; }
.lp-footer-brand img { height: 40px; width: auto; display: block; margin-bottom: 6px; }
.lp-footer-brand-text { display: block; }
.lp-footer-brand-name { display: block; font-weight: 700; }
.lp-footer-tagline { font-size: 0.9rem; opacity: 0.85; line-height: 1.5; }
.lp-footer-heading { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 12px; opacity: 0.9; }
.lp-footer-links { padding: 0; margin: 0; }
.lp-footer-links a { display: block; margin-bottom: 8px; }
.lp-footer-social { display: flex; gap: 12px; margin-top: 12px; }
.lp-footer-social a { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.1); color: inherit; font-size: 0.85rem; }
.lp-footer-social a:hover { background: var(--hub-primary); color: #fff; }
.lp-footer-legal-notice {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: rgba(255,255,255,0.06);
    border-left: 4px solid rgba(255,255,255,0.25);
    font-size: 0.82rem;
    line-height: 1.6;
    color: rgba(255,255,255,0.8);
}
.lp-footer-legal-notice strong { color: rgba(255,255,255,0.95); }
.lp-footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 24px;
    font-size: 0.8rem;
    opacity: 0.8;
}
.lp-footer-legal { display: flex; gap: 20px; }
.lp-footer-legal a { color: rgba(255,255,255,0.75); }
.lp-footer-legal a:hover { color: var(--hub-primary); }
@media (max-width: 640px) {
    .lp-footer-bottom { flex-direction: column; text-align: center; }
}

/* ---- Legal & FAQ sections (SEO: #privacy, #terms, #faq) ---- */
.lp-legal .lp-section-lead { margin-bottom: 1.25rem; }
.lp-faq-list {
    margin: 0;
    padding: 0;
    list-style: none;
}
.lp-faq-list dt {
    font-weight: 600;
    font-size: 1rem;
    margin-top: 1rem;
    margin-bottom: 0.35rem;
    color: var(--hub-text);
}
.lp-faq-list dt:first-of-type { margin-top: 0; }
.lp-faq-list dd {
    margin: 0 0 0 0;
    padding: 0 0 1rem;
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--hub-text-muted);
    border-bottom: 1px solid var(--hub-border);
}
.lp-faq-list dd:last-of-type { border-bottom: none; }
.lp-legal-content {
    font-size: 0.95rem;
    line-height: 1.7;
    color: var(--hub-text-muted);
}
.lp-legal-content p { margin-bottom: 1rem; }
.lp-legal-content a { color: var(--hub-primary); }
.lp-legal-content a:hover { text-decoration: underline; }

/* ---- Legacy simple topbar (used when not using full header) ---- */
.lp-topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 16px 14px;
    background: var(--hub-surface);
    border-bottom: 1px solid var(--hub-border);
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.lp-topbar .lp-logo { display: flex; align-items: center; gap: 10px; }
.lp-topbar .lp-logo img { height: 32px; width: auto; }
.lp-topbar .lp-logo .hub-badge { font-size: 10px; padding: 2px 8px; }
.lp-topbar .lp-signin, .lp-btn-nav {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    background: var(--hub-primary);
    color: #fff;
    font-weight: 600;
    font-size: 14px;
    border-radius: var(--hub-radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 44px;
    transition: background .2s, transform .15s;
    font-family: inherit;
}
.lp-topbar .lp-signin:hover, .lp-btn-nav:hover { background: var(--hub-primary-dark); color: #fff; text-decoration: none; transform: translateY(-1px); }

/* ---- Sections common ---- */
.lp-section {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1.25rem;
}
@media (min-width: 640px) {
    .lp-section { padding: 2.5rem 1.5rem; }
}
@media (min-width: 1024px) {
    .lp-section { padding: 3rem 2rem; }
}

.lp-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.3;
}
@media (min-width: 640px) {
    .lp-section-title { font-size: 1.75rem; }
}
.lp-section-lead {
    font-size: 1rem;
    color: var(--hub-text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
@media (min-width: 640px) {
    .lp-section-lead { font-size: 1.0625rem; margin-bottom: 2rem; }
}

/* ---- Hero ---- */
.lp-hero {
    text-align: center;
    padding-top: 1.5rem;
    padding-bottom: 1rem;
}
@media (min-width: 640px) {
    .lp-hero { padding-top: 2rem; padding-bottom: 1.5rem; }
}
.lp-hero h1 {
    font-size: 1.625rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.75rem;
    letter-spacing: -0.02em;
}
@media (min-width: 640px) {
    .lp-hero h1 { font-size: 2.25rem; margin-bottom: 1rem; }
}
.lp-hero .lp-hero-lead {
    font-size: 1rem;
    color: var(--hub-text-muted);
    max-width: 52rem;
    margin: 0 auto 1.5rem;
    line-height: 1.6;
}
@media (min-width: 640px) {
    .lp-hero .lp-hero-lead { font-size: 1.125rem; margin-bottom: 2rem; }
}
.lp-hero .lp-scroll-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--hub-primary);
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--hub-radius-sm);
    text-decoration: none;
    border: none;
    cursor: pointer;
    min-height: 48px;
    transition: background .2s, transform .15s;
    font-family: inherit;
}
.lp-hero .lp-scroll-link:hover { background: var(--hub-primary-dark); color: #fff; text-decoration: none; transform: translateY(-2px); }

/* Tighter gap between hero and first section */
#features.lp-section { padding-top: 1.25rem; }
@media (min-width: 640px) { #features.lp-section { padding-top: 1.5rem; } }
@media (min-width: 1024px) { #features.lp-section { padding-top: 2rem; } }

/* ---- Feature grid ---- */
.lp-features {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}
@media (min-width: 480px) {
    .lp-features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 768px) {
    .lp-features { grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
}
.lp-feat {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    padding: 1.25rem;
    box-shadow: var(--hub-card-shadow);
    transition: box-shadow .2s, border-color .2s;
}
.lp-feat:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
    border-color: var(--hub-primary);
}
[data-theme="dark"] .lp-feat:hover { border-color: var(--hub-primary); }
.lp-feat-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
    line-height: 1;
}
.lp-feat h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
}
.lp-feat p {
    font-size: 0.875rem;
    color: var(--hub-text-muted);
    margin: 0;
    line-height: 1.5;
}

/* ---- Benefits (two columns on desktop) ---- */
.lp-benefits {
    display: grid;
    gap: 1.5rem;
}
@media (min-width: 768px) {
    .lp-benefits { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.lp-benefit-block {
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    padding: 1.5rem;
    box-shadow: var(--hub-card-shadow);
}
.lp-benefit-block h3 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lp-benefit-block ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lp-benefit-block li {
    font-size: 0.9375rem;
    color: var(--hub-text);
    padding: 0.4rem 0 0.4rem 1.5rem;
    position: relative;
    line-height: 1.5;
}
.lp-benefit-block li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--hub-success);
    font-weight: 700;
}

/* ---- Login modal overlay ---- */
.lp-login-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.lp-login-overlay .lp-login-box-wrap {
    position: relative;
    z-index: 1;
}
.lp-login-overlay.is-open {
    opacity: 1;
    visibility: visible;
}
.lp-login-overlay.is-open .lp-login-box-wrap {
    transform: scale(1);
    opacity: 1;
}
.lp-login-overlay-backdrop {
    position: absolute;
    inset: 0;
    cursor: pointer;
}
.lp-login-box-wrap {
    position: relative;
    width: 100%;
    max-width: 420px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: var(--hub-surface);
    border: 1px solid var(--hub-border);
    border-radius: var(--hub-radius);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.95);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.lp-login-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 2;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: var(--hub-surface-alt);
    color: var(--hub-text-muted);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}
.lp-login-close:hover {
    background: var(--hub-border);
    color: var(--hub-text);
}
.lp-login-box {
    padding: 1.5rem 1.5rem 2rem;
}
@media (min-width: 640px) {
    .lp-login-box { padding: 2rem 2rem 2.5rem; }
}
.lp-login-box .hub-logo {
    justify-content: center;
    margin-bottom: 1rem;
}
.lp-login-box .hub-logo img { height: 36px; }
.lp-login-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 1rem;
}
.lp-login-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    min-height: 44px;
    border-radius: var(--hub-radius-sm);
    border: 1px solid var(--hub-border);
    background: var(--hub-surface-alt);
    color: var(--hub-text-muted);
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.lp-login-tab:hover {
    background: var(--hub-surface);
    color: var(--hub-text);
}
.lp-login-tab.active {
    background: var(--hub-primary);
    color: #fff;
    border-color: var(--hub-primary);
}
.lp-login-box .hub-form-group label { font-size: 14px; }
.lp-login-box .hub-input {
    font-size: 16px;
    min-height: 48px;
    padding: 12px 14px;
}
.lp-login-fullbtn {
    min-height: 48px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px;
}
.lp-login-theme-area { margin-top: 1rem; text-align: center; }
.lp-login-theme-btn {
    border: none;
    background: none;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 8px;
    min-width: 44px;
    min-height: 44px;
}
body.lp-modal-open { overflow: hidden; }

/* ---- Footer ---- */
.lp-footer {
    margin-top: auto;
    text-align: center;
    padding: 1.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--hub-text-muted);
    border-top: 1px solid var(--hub-border);
}
.lp-footer a {
    color: var(--hub-primary);
    text-decoration: none;
}
.lp-footer a:hover { text-decoration: underline; }

/* ---- Utility ---- */
.lp-d-none { display: none !important; }
.lp-text-center { text-align: center; }
