/* Landing page Tesla — app/Modules/Home/Views/index.php */
:root {
    --ts-red: #e31937;
    --ts-red-bright: #ff2e47;
    --ts-red-mid: #c8102e;
    --ts-red-deep: #8f0a1c;
    --ts-ink: #1b1c20;
    --ts-muted: #737782;
    --ts-line: #e6e7ec;
    --ts-card: rgba(255, 255, 255, .97);
    --ts-radius: 18px;
    --ts-shadow: 0 18px 40px rgba(40, 8, 16, .12);
    --ts-font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --ts-display: 'Montserrat', 'Plus Jakarta Sans', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: var(--ts-font);
    color: var(--ts-ink);
    background: #eef0f3 var(--page-bg) center top / 100% auto no-repeat;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0; }

a:focus-visible {
    outline: 2px solid var(--ts-red);
    outline-offset: 3px;
}

.ts-page {
    max-width: 1120px;
    margin: 0 auto;
    overflow: hidden;
    background: rgba(255, 255, 255, .35);
    box-shadow: 0 0 60px rgba(30, 10, 15, .08);
}

/* ---------- Hero ---------- */
.ts-hero {
    position: relative;
    min-height: 500px;
    color: #fff;
    isolation: isolate;
    background:
        linear-gradient(180deg, #0f0608 0%, #22090d 22%, #4a1517 42%, #8e3326 54%, #c9653f 60%, #3a1316 63%, #1a0a0c 100%);
}

.ts-hero-scene {
    position: absolute;
    inset: 0;
    z-index: -1;
    overflow: hidden;
}

.ts-hero-sun {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 38% 22% at 62% 60%, rgba(255, 170, 100, .75), rgba(255, 110, 70, .25) 55%, transparent 75%),
        radial-gradient(ellipse 70% 30% at 20% 58%, rgba(227, 25, 55, .35), transparent 70%);
}

.ts-skyline {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 37%;
    width: 100%;
    height: 40%;
    opacity: .7;
    filter: blur(.6px);
}

/* Gelapkan sisi kiri agar teks hero tetap terbaca di atas skyline. */
.ts-hero-scene::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(12, 4, 6, .78) 0%, rgba(12, 4, 6, .45) 38%, transparent 62%);
}

.ts-hero-floor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 38%;
    background:
        radial-gradient(ellipse 45% 40% at 66% 30%, rgba(255, 150, 110, .35), transparent 70%),
        linear-gradient(180deg, #2a1012 0%, #4d3236 30%, #a29fa5 72%, #e9eaee 100%);
}

.ts-streak {
    position: absolute;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, transparent, var(--ts-red-bright) 40%, #ffd1d7 60%, transparent);
    box-shadow: 0 0 14px rgba(255, 46, 71, .85);
    transform: rotate(-6deg);
}

.ts-streak-1 { left: -8%; bottom: 31%; width: 58%; }
.ts-streak-2 { right: -10%; bottom: 25%; width: 48%; transform: rotate(5deg); opacity: .75; }

.ts-header {
    position: relative;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 34px 0;
}

.ts-brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.ts-brand-emblem {
    height: 34px;
    width: auto;
    filter: brightness(0) invert(1);
}

.ts-brand-wordmark {
    height: 20px;
    width: auto;
    filter: brightness(0) invert(1);
}

.ts-nav {
    display: flex;
    gap: 10px;
}

.ts-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 76px;
    height: 62px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    color: #2a2b31;
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .22);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ts-nav-item img { width: 24px; height: 24px; object-fit: contain; }

.ts-nav-item:hover { transform: translateY(-2px); }

.ts-nav-item.is-active {
    color: #fff;
    background: linear-gradient(160deg, var(--ts-red-bright), #b30d22);
    box-shadow: 0 10px 22px rgba(227, 25, 55, .5);
}

.ts-hero-body {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 12px;
    padding: 34px 34px 104px;
}

.ts-hero-copy { padding-bottom: 20px; }

.ts-hero-title {
    margin: 0;
    font-family: var(--ts-display);
    font-weight: 900;
    font-size: clamp(30px, 5vw, 56px);
    line-height: 1.04;
    letter-spacing: .5px;
    text-transform: uppercase;
    text-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}

.ts-hero-title span { display: block; white-space: nowrap; }

.ts-hero-title .is-red {
    color: var(--ts-red-bright);
    text-shadow: 0 0 22px rgba(255, 46, 71, .45), 0 6px 24px rgba(0, 0, 0, .4);
}

.ts-hero-desc {
    max-width: 290px;
    margin-top: 12px;
    font-size: 16px;
    line-height: 1.5;
    color: rgba(255, 255, 255, .9);
}

.ts-hero-features {
    display: flex;
    gap: 12px;
    margin: 24px 0 0;
    padding: 0;
    list-style: none;
}

.ts-hero-features li {
    width: 74px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: rgba(255, 255, 255, .92);
}

.ts-feature-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .28);
}

.ts-feature-icon img { width: 26px; height: 26px; object-fit: contain; }

.ts-hero-visual {
    position: relative;
    min-height: 330px;
}

.ts-hero-car {
    position: absolute;
    z-index: 2;
    left: -4%;
    bottom: -64px;
    width: 86%;
    filter: drop-shadow(0 18px 18px rgba(0, 0, 0, .35));
}

.ts-hero-charger {
    position: absolute;
    z-index: 1;
    right: 0;
    bottom: -40px;
    height: 104%;
    width: auto;
    filter: drop-shadow(0 0 22px rgba(227, 25, 55, .55)) drop-shadow(0 14px 14px rgba(0, 0, 0, .3));
}

/* ---------- Main ---------- */
.ts-main {
    position: relative;
    z-index: 3;
    display: grid;
    gap: 18px;
    margin-top: -66px;
    padding: 0 26px;
}

.ts-card {
    background: var(--ts-card);
    border: 1px solid rgba(255, 255, 255, .9);
    border-radius: var(--ts-radius);
    box-shadow: var(--ts-shadow);
}

.ts-muted {
    font-size: 12px;
    font-weight: 500;
    color: var(--ts-muted);
}

/* Welcome */
.ts-welcome {
    display: grid;
    grid-template-columns: 1.1fr 1fr .95fr;
    align-items: center;
    padding: 22px 0;
    overflow: hidden;
}

.ts-welcome > * { padding: 0 26px; }
.ts-welcome > * + * { border-left: 1px solid var(--ts-line); }

.ts-welcome-user {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: center;
    gap: 4px 14px;
}

.ts-avatar { width: 64px; height: 64px; object-fit: contain; }

.ts-username {
    margin: 2px 0 6px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;
    word-break: break-word;
}

.ts-badge {
    display: inline-block;
    padding: 3px 14px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--ts-red-bright), var(--ts-red-mid));
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-decoration: none;
}

.ts-balance {
    grid-column: 1 / -1;
    margin-top: 14px;
}

.ts-balance-value {
    margin-top: 2px;
    font-family: var(--ts-display);
    font-size: 28px;
    font-weight: 800;
    color: var(--ts-red);
}

.ts-welcome-stats {
    display: grid;
    gap: 12px;
    margin: 0;
    list-style: none;
}

.ts-welcome-stats li {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ts-welcome-stats img { width: 30px; height: 30px; object-fit: contain; flex: none; }

.ts-stat-value {
    font-size: 15px;
    font-weight: 800;
}

.ts-welcome-quote {
    position: relative;
    align-self: stretch;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 140px;
    padding-right: 70px !important;
    font-family: var(--ts-display);
    font-style: italic;
    font-weight: 600;
    font-size: 17px;
    line-height: 1.45;
}

.ts-welcome-quote strong { color: var(--ts-red); font-weight: 800; }

.ts-welcome-quote::after {
    content: "";
    position: absolute;
    right: -70px;
    top: -60px;
    width: 160px;
    height: 280px;
    border-radius: 50%;
    border: 14px solid transparent;
    border-left-color: var(--ts-red);
    transform: rotate(-14deg);
    opacity: .9;
}

.ts-welcome-quote::before {
    content: "";
    position: absolute;
    right: -88px;
    top: -40px;
    width: 160px;
    height: 280px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-left-color: var(--ts-red-deep);
    transform: rotate(-14deg);
    opacity: .7;
}

/* Quick actions */
.ts-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.ts-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--ts-red-bright) 0%, var(--ts-red-mid) 55%, var(--ts-red-deep) 100%);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(200, 16, 46, .3);
    transition: transform .18s ease, box-shadow .18s ease;
}

.ts-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 28px rgba(200, 16, 46, .38);
}

.ts-action-icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #fff;
}

.ts-action-icon img { width: 28px; height: 28px; object-fit: contain; }

.ts-action-text { display: grid; gap: 2px; min-width: 0; }
.ts-action-text strong { font-size: 15px; font-weight: 800; }
.ts-action-text small { font-size: 11px; opacity: .88; }

.ts-action-arrow {
    margin-left: auto;
    font-size: 26px;
    line-height: 1;
    opacity: .9;
}

/* Banner */
.ts-banner {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    align-items: center;
    gap: 16px;
    min-height: 290px;
    padding: 28px 30px 28px 64px;
    overflow: hidden;
    background: linear-gradient(115deg, #ffffff 0%, #f5f6f9 50%, #e8eaef 100%);
}

.ts-banner::before,
.ts-banner::after {
    content: "";
    position: absolute;
    top: -20%;
    height: 140%;
    transform: skewX(-20deg);
}

.ts-banner::before {
    left: -28px;
    width: 44px;
    background: linear-gradient(180deg, var(--ts-red-bright), var(--ts-red-deep));
    box-shadow: 0 0 24px rgba(227, 25, 55, .45);
}

.ts-banner::after {
    left: 30px;
    width: 4px;
    background: linear-gradient(180deg, transparent, var(--ts-red) 40%, transparent);
    opacity: .75;
}

.ts-banner-copy { position: relative; z-index: 1; }

.ts-banner-wordmark { height: 20px; width: auto; }

.ts-banner h2 {
    margin: 14px 0 10px;
    font-family: var(--ts-display);
    font-size: clamp(26px, 3.7vw, 40px);
    font-weight: 900;
    line-height: 1.05;
    text-transform: uppercase;
}

.ts-banner h2 span { display: block; }

.ts-banner-copy p {
    max-width: 240px;
    margin-bottom: 18px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ts-muted);
}

.ts-banner-visual {
    width: 100%;
    max-height: 270px;
    object-fit: contain;
    filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .18));
}

.ts-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--ts-red-bright), var(--ts-red-mid));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(200, 16, 46, .3);
    transition: filter .18s ease, transform .18s ease;
}

.ts-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ts-btn span { font-size: 18px; line-height: 1; }

.ts-btn-block { width: 100%; padding: 9px 12px; border-radius: 8px; }

/* Products */
.ts-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 14px;
}

.ts-section-head h2 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-family: var(--ts-display);
    font-size: 19px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--ts-red);
}

.ts-section-head h2 img { width: 24px; height: 24px; object-fit: contain; }

.ts-section-head a {
    font-size: 13px;
    font-weight: 600;
    color: var(--ts-muted);
    text-decoration: none;
}

.ts-section-head a:hover { color: var(--ts-red); }

.ts-product-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
}

.ts-product {
    display: flex;
    flex-direction: column;
    padding: 12px 12px 14px;
    border: 1px solid #eceef2;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 24px rgba(20, 10, 15, .08);
    text-align: center;
    transition: transform .18s ease, box-shadow .18s ease;
}

.ts-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 30px rgba(20, 10, 15, .12);
}

.ts-product-media {
    display: grid;
    place-items: center;
    height: 118px;
    padding: 8px;
    border-radius: 10px;
    background: radial-gradient(ellipse at 50% 90%, #e4e6eb 0%, #f4f5f8 55%, #fbfbfc 100%);
}

.ts-product-media img {
    max-height: 100px;
    width: auto;
    object-fit: contain;
}

.ts-product h3 {
    margin: 12px 0 2px;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.25;
}

.ts-product-price {
    margin: 2px 0 12px;
    font-family: var(--ts-display);
    font-size: 17px;
    font-weight: 800;
    color: var(--ts-red);
}

.ts-product .ts-btn { margin-top: auto; }

/* ---------- Footer ---------- */
.ts-footer {
    position: relative;
    margin-top: 36px;
    color: #fff;
    border-radius: 34px 34px 0 0;
    overflow: hidden;
    background:
        radial-gradient(ellipse 50% 90% at 100% 0%, rgba(255, 70, 90, .35), transparent 70%),
        linear-gradient(115deg, #4e040e 0%, #8f0a1c 40%, #c8102e 100%);
}

.ts-footer-main {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 2fr) minmax(0, .6fr);
    align-items: center;
    gap: 24px;
    padding: 30px 36px;
}

.ts-footer-brand p {
    margin-top: 10px;
    font-size: 13px;
    line-height: 1.45;
    color: rgba(255, 255, 255, .88);
}

.ts-footer-brand p span { display: block; }

.ts-footer-features {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.ts-footer-features li {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.ts-footer-icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, .55);
    background: rgba(255, 255, 255, .08);
}

.ts-footer-icon img {
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.ts-footer-emblem {
    justify-self: end;
    height: 120px;
    width: auto;
    opacity: .3;
    filter: brightness(0) invert(1);
}

.ts-footer-bar {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 12px 36px;
    background: rgba(0, 0, 0, .28);
    font-size: 12px;
    color: rgba(255, 255, 255, .78);
}

.ts-footer-bar span:last-child {
    font-family: var(--ts-display);
    font-style: italic;
    letter-spacing: .3px;
}

/* Tab bar mobile */
.ts-tabbar { display: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .ts-welcome { grid-template-columns: 1fr 1fr; row-gap: 18px; }
    .ts-welcome-quote {
        grid-column: 1 / -1;
        min-height: 0;
        padding-top: 16px !important;
        border-left: 0 !important;
        border-top: 1px solid var(--ts-line);
    }
    .ts-welcome-quote::before,
    .ts-welcome-quote::after { top: -120px; }
    .ts-actions { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .ts-product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ts-footer-main { grid-template-columns: 1fr 2fr; }
    .ts-footer-emblem { display: none; }
}

@media (max-width: 720px) {
    body { padding-bottom: 76px; }

    .ts-header { padding: 18px 16px 0; }
    .ts-nav { display: none; }

    .ts-hero { min-height: 0; }
    .ts-hero-body {
        grid-template-columns: 1fr;
        padding: 26px 16px 92px;
    }
    .ts-hero-copy { padding-bottom: 0; }
    .ts-hero-features { gap: 8px; }
    .ts-hero-features li { width: auto; flex: 1; }
    .ts-hero-visual { min-height: 200px; }
    .ts-hero-car { width: 80%; bottom: -54px; }
    .ts-hero-charger { height: 112%; bottom: -30px; }

    .ts-main { padding: 0 16px; margin-top: -60px; }

    .ts-welcome { grid-template-columns: 1fr; padding: 18px 0; }
    .ts-welcome > * { padding: 0 18px; }
    .ts-welcome > * + * {
        border-left: 0;
        border-top: 1px solid var(--ts-line);
        padding-top: 16px;
    }
    .ts-welcome-quote { padding-right: 80px !important; }
    .ts-welcome-quote::before,
    .ts-welcome-quote::after { top: -30px; height: 190px; }

    .ts-actions { gap: 10px; }
    .ts-action { padding: 12px; gap: 10px; }
    .ts-action-icon { width: 40px; height: 40px; }
    .ts-action-icon img { width: 24px; height: 24px; }
    .ts-action-text strong { font-size: 14px; }
    .ts-action-arrow { display: none; }

    .ts-banner {
        grid-template-columns: 1fr;
        padding: 26px 18px 18px 44px;
    }
    .ts-banner::before,
    .ts-banner::after { transform: skewX(-4deg); }
    .ts-banner::before { left: -22px; width: 34px; }
    .ts-banner::after { left: 22px; }

    .ts-product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

    .ts-footer-main { grid-template-columns: 1fr; padding: 26px 16px; }
    .ts-footer-features { gap: 6px; }
    .ts-footer-bar { padding: 12px 16px; }

    .ts-tabbar {
        position: fixed;
        z-index: 50;
        left: 0;
        right: 0;
        bottom: 0;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
        background: rgba(255, 255, 255, .97);
        box-shadow: 0 -8px 24px rgba(30, 10, 15, .12);
    }
    .ts-tabbar a {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 3px;
        padding: 6px 0;
        border-radius: 12px;
        font-size: 11px;
        font-weight: 700;
        color: #3a3b41;
        text-decoration: none;
    }
    .ts-tabbar img { width: 22px; height: 22px; object-fit: contain; }
    .ts-tabbar a.is-active {
        color: #fff;
        background: linear-gradient(160deg, var(--ts-red-bright), #b30d22);
    }
}

@media (max-width: 380px) {
    .ts-actions { grid-template-columns: 1fr; }
    .ts-hero-features li { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
}
