/* ===================================================
   宙豐國際租賃 — app.css
   Design System & Custom Component Styles
   =================================================== */

/* ---------- Google Fonts ---------- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+TC:wght@300;400;500;700;900&family=Inter:wght@400;500;600;700&display=swap');

/* ---------- CSS Variables ---------- */
:root {
    --primary: #1a56db;
    --primary-dark: #1e3a8a;
    --accent: #fbbf24;
    --success: #10b981;
    --danger: #ef4444;
    --text-dark: #1f2937;
    --text-mid: #374151;
    --text-light: #6b7280;
    --text-muted: #9ca3af;
    --bg-light: #f9fafb;
    --border: #e5e7eb;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 20px rgba(0, 0, 0, .08);
    --font-tc: 'Noto Sans TC', sans-serif;
    --font-en: 'Inter', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-tc);
    color: var(--text-dark);
    background: #fff;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--primary);
    transition: color .2s;
}

a:hover {
    color: var(--primary-dark);
}

img {
    max-width: 100%;
    height: auto;
}

/* ---------- Preloader ---------- */
#preloader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity .4s ease;
}

.preloader-wrap {
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin .8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Navbar ---------- */
.navbar {
    padding: .75rem 0;
    background: #fff !important;
    box-shadow: 0 1px 8px rgba(0, 0, 0, .07);
    transition: box-shadow .3s;
}

.navbar-brand {
    gap: .5rem !important;
}

/* Force horizontal nav on desktop */
@media (min-width: 992px) {
    .navbar-collapse {
        display: flex !important;
        align-items: center;
    }

    .navbar-nav {
        flex-direction: row !important;
        gap: .25rem;
    }
}

.navbar .nav-link {
    font-size: .9rem;
    font-weight: 500;
    color: var(--text-dark) !important;
    padding: .5rem .75rem !important;
    border-radius: var(--radius-sm);
    transition: background .2s, color .2s;
}

.navbar .nav-link:hover {
    background: #eff6ff;
    color: var(--primary) !important;
}

.navbar .dropdown-menu {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
}

.navbar .dropdown-item {
    font-size: .875rem;
    padding: .5rem 1rem;
    color: var(--text-mid);
}

.navbar .dropdown-item:hover {
    background: #eff6ff;
    color: var(--primary);
}

.btn-apply {
    background: var(--primary);
    color: #fff !important;
    font-size: .875rem;
    font-weight: 700;
    padding: .5rem 1.25rem;
    border-radius: 999px;
    text-decoration: none;
    transition: background .2s, transform .15s;
    white-space: nowrap;
}

.btn-apply:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

/* ---------- Hero Section ---------- */
.hero-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 5rem 0 4rem;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-section h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 900;
    line-height: 1.15;
}

/* ---------- Buttons ---------- */
.btn-cta {
    display: inline-block;
    background: var(--accent);
    color: var(--text-dark) !important;
    font-weight: 800;
    font-size: .95rem;
    padding: 1rem 2rem;
    border-radius: 999px;
    text-decoration: none;
    transition: transform .2s, box-shadow .2s, background .2s;
    white-space: nowrap;
}

.btn-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(251, 191, 36, .4);
    background: #f59e0b;
    color: var(--text-dark) !important;
}

/* ---------- Trust Badge ---------- */
.badge-legal {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    background: rgba(251, 191, 36, .18);
    color: #fbbf24;
    border: 1.5px solid rgba(251, 191, 36, .55);
    padding: .6rem 1.35rem;
    border-radius: 999px;
    font-size: .95rem;
    font-weight: 800;
    letter-spacing: .02em;
    box-shadow: 0 0 18px rgba(251, 191, 36, .22);
    animation: badge-pulse 2.8s ease-in-out infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        box-shadow: 0 0 14px rgba(251, 191, 36, .22);
    }

    50% {
        box-shadow: 0 0 28px rgba(251, 191, 36, .48);
    }
}

/* ---------- Section Typography ---------- */
.section-title {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
    color: var(--text-dark);
    line-height: 1.3;
    margin-bottom: .75rem;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Product Cards ---------- */
.product-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.75rem 1.5rem;
    height: 100%;
    text-align: center;
    transition: transform .25s, box-shadow .25s, border-color .25s;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .1);
    border-color: var(--primary);
}

.product-card .icon-wrap {
    font-size: 2.25rem;
    margin-bottom: .875rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-img {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

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

.icon-img-lg {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.fa-icon-box {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary);
    font-size: 1.1rem;
}

.product-card h3 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-dark);
    margin-bottom: .5rem;
}

.rate-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: .3rem .875rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 700;
}

/* ---------- Process Steps ---------- */
.step-item {
    text-align: center;
    padding: 2rem 1.5rem;
    background: #fff;
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.step-number {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50%;
    font-size: 1.25rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    box-shadow: 0 6px 16px rgba(26, 86, 219, .35);
}

/* ---------- Calculator Widget ---------- */
.calculator-widget {
    background: #fff;
    border-radius: 1.25rem;
    padding: 2rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .15);
}

.calc-monthly,
.calc-result .calc-monthly {
    font-size: 2rem;
    font-weight: 900;
    color: var(--primary);
    font-family: var(--font-en);
}

.calc-result {
    background: var(--bg-light);
    border-radius: var(--radius-sm);
    padding: 1.25rem;
    border: 1px solid var(--border);
}

.range-slider {
    width: 100%;
    height: 6px;
    appearance: none;
    -webkit-appearance: none;
    background: linear-gradient(to right, var(--primary) var(--value, 50%), #e5e7eb var(--value, 50%));
    border-radius: 999px;
    outline: none;
    cursor: pointer;
    margin: .5rem 0;
}

.range-slider::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(26, 86, 219, .4);
    cursor: pointer;
    transition: transform .15s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
}

/* ---------- Blog Cards ---------- */
.blog-card {
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform .25s, box-shadow .25s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
}

.blog-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.blog-card .card-body {
    padding: 1.25rem;
}

.category-badge {
    display: inline-block;
    background: #eff6ff;
    color: var(--primary);
    padding: .2rem .75rem;
    border-radius: 999px;
    font-size: .75rem;
    font-weight: 700;
}

/* ---------- CTA Section ---------- */
.cta-section {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: #fff;
    padding: 5rem 0;
    text-align: center;
}

.cta-section h2 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 900;
}

/* ---------- Forms ---------- */
.form-label {
    font-weight: 600;
    font-size: .9rem;
    color: var(--text-dark);
    margin-bottom: .4rem;
}

.form-control,
.form-select {
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    padding: .75rem 1rem;
    font-size: .9rem;
    font-family: var(--font-tc);
    transition: border-color .2s, box-shadow .2s;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(26, 86, 219, .12);
    outline: none;
}

.form-control.is-invalid,
.form-select.is-invalid {
    border-color: var(--danger);
}

.invalid-feedback {
    font-size: .8rem;
    color: var(--danger);
    margin-top: .25rem;
}

/* ---------- Footer ---------- */
footer {
    background: #111827;
    color: rgba(255, 255, 255, .75);
    padding: 3.5rem 0 0;
    font-size: .9rem;
}

footer h5 {
    color: #fff;
    font-size: .95rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

footer ul li {
    margin-bottom: .5rem;
}

footer ul li a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    transition: color .2s;
}

footer ul li a:hover {
    color: #fff;
}

footer a {
    color: rgba(255, 255, 255, .6);
    text-decoration: none;
    transition: color .2s;
}

footer a:hover {
    color: #fff;
}

.footer-bottom {
    margin-top: 3rem;
    padding: 1.25rem 0;
    border-top: 1px solid rgba(255, 255, 255, .1);
    font-size: .8rem;
    color: rgba(255, 255, 255, .4);
}

/* ---------- Back to Top ---------- */
.back-to-top {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s, transform .3s;
    z-index: 999;
    box-shadow: 0 4px 12px rgba(26, 86, 219, .4);
    display: flex;
    align-items: center;
    justify-content: center;
}

.back-to-top.visible {
    opacity: 1;
    pointer-events: all;
}

.back-to-top:hover {
    transform: translateY(-3px);
}

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
    .hero-section {
        padding: 3rem 0;
    }

    .navbar-nav {
        gap: 0;
    }

    .navbar .nav-link {
        border-radius: 0;
    }

    .calculator-widget {
        margin-top: 2rem;
    }
}

@media (max-width: 767.98px) {
    .section-title {
        font-size: 1.5rem;
    }

    .step-number {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}