/* =====================================================================
   CargoFlow — Public site stylesheet
   Built on Bootstrap 5 + custom design system, with dark-mode support.
   ===================================================================== */

:root {
    --cf-brand: #e82127;
    --cf-brand-2: #f43f47;
    --cf-brand-dark: #b3121b;
    --cf-accent: #f97316;
    --cf-orange: #f97316;
    --cf-green: #10b981;
    --cf-ink: #0f172a;
    --cf-ink-soft: #1e293b;
    --cf-surface: #ffffff;
    --cf-surface-2: #f8fafc;
    --cf-border: #e2e8f0;
    --cf-text: #1e293b;
    --cf-text-muted: #64748b;
    --cf-grad: linear-gradient(135deg, #e82127 0%, #f97316 100%);
    --cf-grad-btn: linear-gradient(135deg, #ff2e33 0%, #e82127 55%, #a80f17 100%);
    --cf-radius: 16px;
    --cf-shadow: 0 10px 40px rgba(15, 23, 42, .08);
    --cf-shadow-lg: 0 24px 60px rgba(15, 23, 42, .14);
}

/* Re-theme Bootstrap's primary color to the CargoFlow brand (Tesla red) so
   utility classes like text-primary, bg-primary and .progress-bar match. */
:root {
    --bs-primary: #e82127;
    --bs-primary-rgb: 232, 33, 39;
    --bs-link-color: #e82127;
    --bs-link-color-rgb: 232, 33, 39;
    --bs-link-hover-color: #b3121b;
    --bs-link-hover-color-rgb: 179, 18, 27;
}
.btn-primary {
    --bs-btn-bg: #e82127;
    --bs-btn-border-color: #e82127;
    --bs-btn-hover-bg: #c4161f;
    --bs-btn-hover-border-color: #c4161f;
    --bs-btn-active-bg: #b3121b;
    --bs-btn-active-border-color: #b3121b;
    --bs-btn-disabled-bg: #e82127;
    --bs-btn-disabled-border-color: #e82127;
}

[data-bs-theme="dark"] {
    --cf-ink: #0b1120;
    --cf-ink-soft: #111a2e;
    --cf-surface: #0f172a;
    --cf-surface-2: #16213a;
    --cf-border: #24324a;
    --cf-text: #e2e8f0;
    --cf-text-muted: #94a3b8;
    --cf-shadow: 0 10px 40px rgba(0, 0, 0, .4);
    --cf-shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
}

* { -webkit-font-smoothing: antialiased; }

html { scroll-behavior: smooth; }

body {
    font-family: "Inter", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    background-color: var(--cf-surface);
    color: var(--cf-text);
    transition: background-color .3s ease, color .3s ease;
}

h1, h2, h3, h4, h5, h6,
.display-1, .display-2, .display-3, .display-4, .display-5, .display-6 {
    font-family: "Space Grotesk", "Inter", sans-serif;
    font-weight: 700;
    letter-spacing: -.02em;
}

.navbar-cf .navbar-brand,
.stat-value, .step-num {
    font-family: "Space Grotesk", "Inter", sans-serif;
}

a { color: var(--cf-brand); text-decoration: none; }
a:hover { color: var(--cf-brand-dark); }

.text-gradient {
    background: var(--cf-grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.bg-ink { background-color: var(--cf-ink); }
.bg-surface { background-color: var(--cf-surface); }
.bg-surface-2 { background-color: var(--cf-surface-2); }
.text-muted-2 { color: var(--cf-text-muted) !important; }

/* ------------------------------------------------------------------ */
/* Buttons                                                             */
/* ------------------------------------------------------------------ */
.btn-brand {
    background: var(--cf-grad-btn);
    color: #fff;
    border: none;
    font-weight: 600;
    border-radius: 12px;
    padding: .7rem 1.4rem;
    transition: transform .15s ease, box-shadow .2s ease;
}
.btn-brand:hover, .btn-brand:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(232, 33, 39, .35);
}
.btn-ghost {
    background: transparent;
    color: var(--cf-text);
    border: 1.5px solid var(--cf-border);
    font-weight: 600;
    border-radius: 12px;
    padding: .65rem 1.3rem;
}
.btn-ghost:hover { border-color: var(--cf-brand); color: var(--cf-brand); }
.btn-outline-white {
    border: 1.5px solid rgba(255, 255, 255, .4);
    color: #fff;
    font-weight: 600;
    border-radius: 12px;
    padding: .65rem 1.3rem;
}
.btn-outline-white:hover { background: #fff; color: var(--cf-ink); }

/* ------------------------------------------------------------------ */
/* Navbar                                                              */
/* ------------------------------------------------------------------ */
.navbar-cf {
    padding: .9rem 0;
    transition: background-color .3s ease, box-shadow .3s ease;
    background: var(--cf-surface);
}
.navbar-cf.scrolled {
    background: color-mix(in srgb, var(--cf-surface) 88%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: var(--cf-shadow);
}
.navbar-cf .navbar-brand { font-weight: 800; font-size: 1.4rem; color: var(--cf-text); }
.navbar-cf .navbar-brand .mark { color: var(--cf-brand); }
.navbar-cf .nav-link {
    color: var(--cf-text-muted);
    font-weight: 600;
    margin: 0 .15rem;
    padding: .5rem .8rem;
    border-radius: 10px;
}
.navbar-cf .nav-link:hover,
.navbar-cf .nav-link.active { color: var(--cf-brand); }

.theme-toggle {
    width: 40px; height: 40px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 12px; border: 1.5px solid var(--cf-border);
    background: transparent; color: var(--cf-text);
    cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Hero                                                                */
/* ------------------------------------------------------------------ */
.hero {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(1100px 500px at 85% -10%, rgba(249, 115, 22, .16), transparent 60%),
        radial-gradient(900px 500px at 0% 110%, rgba(232, 33, 39, .15), transparent 55%),
        var(--cf-surface);
    padding: 5rem 0 6rem;
}
.hero .badge-pill {
    background: color-mix(in srgb, var(--cf-brand) 12%, transparent);
    color: var(--cf-brand);
    border: 1px solid color-mix(in srgb, var(--cf-brand) 30%, transparent);
    border-radius: 999px;
    padding: .45rem 1rem;
    font-weight: 600;
    font-size: .85rem;
}
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.8rem); line-height: 1.08; }
.hero .hero-illustration {
    position: relative;
    z-index: 2;
}

/* Floating hero cards */
.float-card {
    position: absolute;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    box-shadow: var(--cf-shadow-lg);
    padding: .9rem 1rem;
    z-index: 3;
    animation: floaty 5s ease-in-out infinite;
}
.float-card .icon {
    width: 40px; height: 40px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    color: #fff;
}
@keyframes floaty {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-12px); }
}

/* ------------------------------------------------------------------ */
/* Tracking widget                                                     */
/* ------------------------------------------------------------------ */
.track-widget {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 20px;
    box-shadow: var(--cf-shadow-lg);
    padding: 1.5rem;
}
.track-widget .input-group .form-control {
    border-radius: 12px 0 0 12px;
    border: 1.5px solid var(--cf-border);
    padding: .85rem 1rem;
    background: var(--cf-surface-2);
    color: var(--cf-text);
}
.track-widget .input-group .form-control:focus {
    box-shadow: 0 0 0 4px rgba(232, 33, 39, .15);
    border-color: var(--cf-brand);
    background: var(--cf-surface);
}
.track-widget .input-group .btn {
    border-radius: 0 12px 12px 0;
}

/* ------------------------------------------------------------------ */
/* Sections                                                            */
/* ------------------------------------------------------------------ */
.section { padding: 5rem 0; }
.section-head { max-width: 640px; }
.eyebrow {
    text-transform: uppercase;
    letter-spacing: .12em;
    font-weight: 700;
    font-size: .8rem;
    color: var(--cf-brand);
}

/* Feature / service cards */
.feature-card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: var(--cf-radius);
    padding: 1.8rem;
    height: 100%;
    transition: transform .2s ease, box-shadow .25s ease, border-color .25s ease;
}
.feature-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--cf-shadow-lg);
    border-color: color-mix(in srgb, var(--cf-brand) 40%, var(--cf-border));
}
.feature-icon {
    width: 56px; height: 56px;
    border-radius: 14px;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1rem;
}
.fi-blue   { background: rgba(232, 33, 39, .12); color: #e82127; }
.fi-cyan   { background: rgba(6, 182, 212, .14);  color: #0891b2; }
.fi-orange { background: rgba(249, 115, 22, .14); color: #ea580c; }
.fi-green  { background: rgba(16, 185, 129, .14); color: #059669; }
.fi-violet { background: rgba(139, 92, 246, .14); color: #7c3aed; }
.fi-pink   { background: rgba(236, 72, 153, .14); color: #db2777; }

/* Stats strip */
.stat-strip { background: var(--cf-ink); color: #fff; }
.stat-strip .stat-value { font-size: 2.2rem; font-weight: 800; }
.stat-strip .stat-label { color: #94a3b8; font-size: .9rem; }

/* Services list */
.service-line {
    display: flex; align-items: center; gap: 1rem;
    padding: 1.1rem 1.25rem;
    border: 1px solid var(--cf-border);
    border-radius: 14px;
    background: var(--cf-surface);
    transition: box-shadow .2s ease, transform .2s ease;
}
.service-line:hover { box-shadow: var(--cf-shadow); transform: translateX(4px); }

/* Steps */
.step-card {
    text-align: center;
    padding: 2rem 1.2rem;
}
.step-num {
    width: 56px; height: 56px; margin: 0 auto 1rem;
    border-radius: 50%;
    background: var(--cf-grad);
    color: #fff; font-weight: 800; font-size: 1.4rem;
    display: flex; align-items: center; justify-content: center;
}

/* CTA band */
.cta-band {
    background: var(--cf-grad);
    color: #fff;
    border-radius: 24px;
    padding: 3.5rem 2.5rem;
    position: relative;
    overflow: hidden;
}
.cta-band::after {
    content: "";
    position: absolute; right: -80px; top: -80px;
    width: 280px; height: 280px; border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}
.cta-band::before {
    content: "";
    position: absolute; right: 60px; bottom: -120px;
    width: 200px; height: 200px; border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}

/* ------------------------------------------------------------------ */
/* Timeline (tracking result)                                          */
/* ------------------------------------------------------------------ */
.timeline { position: relative; padding-left: 2.2rem; }
.timeline::before {
    content: "";
    position: absolute; left: 11px; top: 8px; bottom: 8px;
    width: 2px;
    background: var(--cf-border);
}
.timeline-item { position: relative; padding-bottom: 1.6rem; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
    position: absolute; left: -2.2rem; top: 2px;
    width: 24px; height: 24px; border-radius: 50%;
    background: var(--cf-surface);
    border: 2px solid var(--cf-border);
    display: flex; align-items: center; justify-content: center;
    font-size: .7rem;
}
.timeline-item.completed .timeline-dot {
    background: var(--cf-green); border-color: var(--cf-green); color: #fff;
}
.timeline-item.current .timeline-dot {
    background: var(--cf-brand); border-color: var(--cf-brand); color: #fff;
    box-shadow: 0 0 0 5px rgba(232, 33, 39, .18);
}
.timeline-item .tl-time { font-size: .8rem; color: var(--cf-text-muted); }
.timeline-item .tl-status { font-weight: 700; }

/* ------------------------------------------------------------------ */
/* Quote & forms                                                       */
/* ------------------------------------------------------------------ */
.form-card {
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 20px;
    box-shadow: var(--cf-shadow);
}
.form-control, .form-select {
    border-radius: 12px;
    border: 1.5px solid var(--cf-border);
    padding: .7rem 1rem;
    background-color: var(--cf-surface);
    color: var(--cf-text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--cf-brand);
    box-shadow: 0 0 0 4px rgba(232, 33, 39, .14);
    background-color: var(--cf-surface);
}
.form-label { font-weight: 600; font-size: .9rem; }

/* Map container */
.map-holder {
    border-radius: var(--cf-radius);
    overflow: hidden;
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-2);
    min-height: 320px;
}

/* ------------------------------------------------------------------ */
/* Footer                                                              */
/* ------------------------------------------------------------------ */
.footer {
    background: var(--cf-ink);
    color: #cbd5e1;
    padding: 4rem 0 2rem;
}
.footer h6 { color: #fff; }
.footer a { color: #94a3b8; }
.footer a:hover { color: #fff; }
.footer .social a {
    width: 38px; height: 38px; border-radius: 10px;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255, 255, 255, .06);
    color: #cbd5e1;
}
.footer .social a:hover { background: var(--cf-brand); color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); margin-top: 2.5rem; padding-top: 1.5rem; }

/* ------------------------------------------------------------------ */
/* Floating language switcher (Google Translate)                       */
/* ------------------------------------------------------------------ */
/* Minimal floating language switcher — fixed on the left edge */
.cf-lang-switcher {
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .4rem;
}
/* Hidden Google Translate host element (we drive its combo programmatically) */
.cf-lang-switcher .cf-lang-gte {
    position: absolute;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}
.cf-lang-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid var(--cf-border);
    background: var(--cf-surface);
    color: var(--cf-text);
    box-shadow: var(--cf-shadow);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.05rem;
    cursor: pointer;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.cf-lang-btn:hover {
    border-color: var(--cf-brand);
    box-shadow: var(--cf-shadow-lg);
    transform: scale(1.05);
}
.cf-lang-btn .cf-lang-current {
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
    position: absolute;
    bottom: -2px;
    right: -4px;
    background: var(--cf-brand);
    color: #fff;
    border-radius: 999px;
    padding: 1px 5px;
    line-height: 1.25;
    pointer-events: none;
}
.cf-lang-menu {
    display: none;
    flex-direction: column;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 12px;
    box-shadow: var(--cf-shadow-lg);
    padding: .3rem;
    max-height: min(60vh, 380px);
    overflow-y: auto;
    min-width: 118px;
}
.cf-lang-switcher.open .cf-lang-menu { display: flex; }
.cf-lang-menu button {
    border: 0;
    background: transparent;
    color: var(--cf-text);
    font-size: .8rem;
    font-weight: 600;
    text-align: left;
    padding: .35rem .6rem;
    border-radius: 8px;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s ease, color .15s ease;
}
.cf-lang-menu button:hover { background: var(--cf-surface-2); color: var(--cf-brand); }
.cf-lang-menu button.active { background: var(--cf-brand); color: #fff; }
/* Keep the design clean while a translation is active */
.goog-te-banner-frame,
#goog-gt-tt, .goog-te-balloon-frame,
body > iframe.skiptranslate { display: none !important; }
body { top: 0 !important; }
font img.goog-te-highlight { box-shadow: none !important; background: transparent !important; }
@media (max-width: 575.98px) {
    .cf-lang-switcher { left: 8px; }
    .cf-lang-btn { width: 36px; height: 36px; font-size: .95rem; }
}

/* ------------------------------------------------------------------ */
/* Page preloader                                                      */
/* ------------------------------------------------------------------ */
.cf-preloader {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--cf-surface);
    transition: opacity .45s ease, visibility .45s ease;
}
.cf-preloader.done {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.cf-preloader-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}
.cf-preloader-inner svg { animation: cfPulse 1.2s ease-in-out infinite; }
.cf-preloader-bar {
    width: 120px;
    height: 4px;
    border-radius: 999px;
    background: var(--cf-border);
    overflow: hidden;
}
.cf-preloader-bar span {
    display: block;
    height: 100%;
    width: 40%;
    border-radius: 999px;
    background: var(--cf-grad);
    animation: cfSlide 1.1s ease-in-out infinite;
}
@keyframes cfPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(.9); opacity: .75; }
}
@keyframes cfSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(320%); }
}
@media (prefers-reduced-motion: reduce) {
    .cf-preloader { display: none !important; }
}

/* ------------------------------------------------------------------ */
/* Toast                                                               */
/* ------------------------------------------------------------------ */
.cf-toast {
    position: fixed; bottom: 24px; right: 24px; z-index: 1080;
    max-width: 360px;
}

/* ------------------------------------------------------------------ */
/* Reveal-on-scroll animations                                         */
/* ------------------------------------------------------------------ */
/* Content is visible by default; it's only hidden for the entrance
   animation when JS is confirmed running (html.cf-js), so shipment
   results and sections can never be stuck invisible. */
html.cf-js .reveal { opacity: 0; transform: translateY(24px); transition: opacity .6s ease, transform .6s ease; }
html.cf-js .reveal.in { opacity: 1; transform: translateY(0); }

/* ------------------------------------------------------------------ */
/* Responsive tweaks                                                   */
/* ------------------------------------------------------------------ */
@media (max-width: 991.98px) {
    .hero { padding: 3rem 0 4rem; }
    .section { padding: 3.5rem 0; }
    .float-card { display: none; }
}


/* ------------------------------------------------------------------ */
/* Tracking result — package photo                                     */
/* ------------------------------------------------------------------ */
.package-photo {
    position: relative;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--cf-border);
    background: var(--cf-surface-2);
}
.package-photo img {
    display: block;
    width: 100%;
    height: 190px;
    object-fit: cover;
}
.package-photo-tag {
    position: absolute;
    left: 10px;
    bottom: 10px;
    display: inline-flex;
    align-items: center;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: .72rem;
    font-weight: 600;
    letter-spacing: .03em;
    padding: .3rem .6rem;
    border-radius: 999px;
    backdrop-filter: blur(4px);
}

/* ------------------------------------------------------------------ */
/* Page imagery                                                        */
/* ------------------------------------------------------------------ */
.page-visual,
.service-card-img,
.avatar-img {
    display: block;
    max-width: 100%;
}
.page-visual {
    width: 100%;
    border-radius: 24px;
    object-fit: cover;
    box-shadow: var(--cf-shadow-lg);
    border: 1px solid color-mix(in srgb, var(--cf-border) 70%, transparent);
}
.hero .page-visual {
    aspect-ratio: 4 / 3;
    min-height: 420px;
}
.image-card {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--cf-surface-2);
}
.image-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 45%, rgba(15, 23, 42, .45));
    pointer-events: none;
}
.hero-illustration .track-widget {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 28px;
    z-index: 4;
    background: color-mix(in srgb, var(--cf-surface) 90%, transparent);
    backdrop-filter: blur(14px);
}
.service-card-img {
    width: 100%;
    aspect-ratio: 16 / 10;
    object-fit: cover;
    border-radius: 14px;
    margin-bottom: 1.2rem;
    border: 1px solid var(--cf-border);
}
.avatar-img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 50%;
    border: 3px solid color-mix(in srgb, var(--cf-brand) 30%, var(--cf-surface));
    box-shadow: 0 8px 22px rgba(15, 23, 42, .12);
}
.team-avatar {
    width: 116px;
    height: 116px;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid color-mix(in srgb, var(--cf-brand) 25%, var(--cf-surface));
    box-shadow: var(--cf-shadow);
}
.feature-card.with-media { overflow: hidden; }
.auth-wrap {
    background-image:
        linear-gradient(135deg, color-mix(in srgb, var(--cf-surface) 84%, transparent), color-mix(in srgb, var(--cf-surface) 70%, transparent)),
        url('../img/pages/login-background.png') !important;
    background-size: cover !important;
    background-position: center !important;
}
@media (max-width: 991.98px) {
    .hero .page-visual { min-height: 360px; }
    .hero-illustration .track-widget { position: relative; left: auto; right: auto; bottom: auto; margin-top: -2rem; }
}
