:root {
    --purple: #4B2B91;
    --purple-dark: #3a2170;
    --purple-light: #6b3fc4;
    --gold: #FFC107;
    --gold-dark: #e6ac00;
    --dark: #1A1A2E;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-500: #6c757d;
    --gray-800: #343a40;
    --white: #ffffff;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(75, 43, 145, 0.12);
    --font: 'Inter', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: var(--font);
    color: var(--gray-800);
    line-height: 1.6;
    background: var(--white);
}

img { max-width: 100%; display: block; }
a { color: var(--purple); text-decoration: none; }
a:hover { color: var(--purple-light); }

.container { max-width: 1200px; margin: 0 auto; padding: 0 1.25rem; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: 0.65rem 1.25rem; border-radius: 8px; font-weight: 600;
    border: 2px solid transparent; cursor: pointer; font-size: 0.95rem;
    transition: all 0.2s;
}
.btn-primary { background: var(--purple); color: var(--white); }
.btn-primary:hover { background: var(--purple-dark); color: var(--white); }
.btn-accent { background: var(--gold); color: var(--dark); }
.btn-accent:hover { background: var(--gold-dark); color: var(--dark); }
.btn-outline { background: transparent; border-color: var(--purple); color: var(--purple); }
.btn-outline:hover { background: var(--purple); color: var(--white); }
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.85rem; }
.btn-lg { padding: 0.85rem 1.75rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; color: var(--purple); cursor: pointer; font-size: inherit; }
.btn-link.danger { color: #dc3545; }

/* Navbar */
.navbar { background: var(--white); box-shadow: 0 1px 0 var(--gray-200); position: sticky; top: 0; z-index: 100; }
.nav-inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; }
.brand-logo { height: 48px; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; list-style: none; }
.nav-links a { font-weight: 500; color: var(--gray-800); }
.nav-toggle { display: none; background: none; border: none; font-size: 1.5rem; cursor: pointer; }

/* Hero */
.hero { background: linear-gradient(135deg, var(--dark) 0%, var(--purple-dark) 100%); color: var(--white); padding: 4rem 0; }
.hero-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 3rem; align-items: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); line-height: 1.15; margin: 1rem 0; }
.text-accent { color: var(--gold); }
.badge { background: rgba(255,193,7,0.2); color: var(--gold); padding: 0.35rem 0.85rem; border-radius: 999px; font-size: 0.85rem; font-weight: 600; }
.hero-actions { display: flex; gap: 1rem; margin-top: 1.5rem; flex-wrap: wrap; }
.hero-card { background: rgba(255,255,255,0.08); border-radius: var(--radius); padding: 2rem; backdrop-filter: blur(8px); }
.hero-stat { padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,0.1); }
.hero-stat:last-child { border: none; }
.hero-stat strong { display: block; font-size: 1.75rem; color: var(--gold); }
.hero-stat span { font-size: 0.9rem; opacity: 0.85; }

/* Sections */
.section { padding: 4rem 0; }
.section-alt { background: var(--gray-100); }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem; }
.section-header h2 { font-size: 1.75rem; color: var(--purple); }
.page-header { background: var(--gray-100); padding: 2.5rem 0; }
.page-header h1 { color: var(--purple); font-size: 2rem; }
.back-link { display: inline-block; margin-bottom: 0.75rem; font-size: 0.9rem; }

/* Vehicle grid */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.vehicle-card { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); transition: transform 0.2s, box-shadow 0.2s; color: inherit; }
.vehicle-card:hover { transform: translateY(-4px); box-shadow: 0 8px 32px rgba(75,43,145,0.18); color: inherit; }
.vehicle-card-image { position: relative; aspect-ratio: 16/10; background: var(--gray-200); }
.vehicle-card-image img { width: 100%; height: 100%; object-fit: cover; }
.vehicle-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; font-weight: 700; color: var(--purple); font-size: 1.25rem; }
.vehicle-badge { position: absolute; top: 0.75rem; right: 0.75rem; background: var(--purple); color: var(--white); padding: 0.25rem 0.65rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; text-transform: capitalize; }
.vehicle-card-body { padding: 1.25rem; }
.vehicle-card-body h3 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.vehicle-meta { color: var(--gray-500); font-size: 0.9rem; }
.vehicle-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 1rem; }
.price { font-weight: 700; color: var(--purple); font-size: 1.1rem; }
.price small { font-weight: 400; font-size: 0.8rem; color: var(--gray-500); }
.link-arrow { color: var(--gold-dark); font-weight: 600; }

/* Features */
.features-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }
.feature-card { background: var(--white); padding: 1.5rem; border-radius: var(--radius); box-shadow: var(--shadow); border-left: 4px solid var(--gold); }
.feature-icon { display: flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 10px; background: rgba(75,43,145,0.08); color: var(--purple); font-size: 1.35rem; margin-bottom: 0.85rem; }
.feature-card h3 { color: var(--purple); margin-bottom: 0.5rem; }
.back-link { display: inline-flex; align-items: center; gap: 0.35rem; }

/* CTA */
.cta-section { padding: 3rem 0 5rem; }
.cta-box { background: linear-gradient(135deg, var(--purple), var(--purple-dark)); color: var(--white); text-align: center; padding: 3rem; border-radius: var(--radius); }
.cta-box h2 { font-size: 2rem; margin-bottom: 0.5rem; }

/* Vehicle detail — photo gallery */
.vehicle-detail-grid { display: grid; grid-template-columns: 1.45fr 1fr; gap: 2rem; align-items: start; }

.vehicle-gallery-panel {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

.gallery-main {
    position: relative;
    background: var(--gray-100);
}
.gallery-main-frame { margin: 0; }
.gallery-main-frame img {
    width: 100%;
    height: 420px;
    object-fit: cover;
    display: block;
}
.gallery-main-frame figcaption {
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    color: var(--gray-500);
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: rgba(255,255,255,0.92);
    color: var(--purple);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    transition: background 0.2s;
}
.gallery-nav:hover { background: var(--white); color: var(--purple-dark); }
.gallery-prev { left: 0.75rem; }
.gallery-next { right: 0.75rem; }

.gallery-thumbs {
    display: flex;
    gap: 0.5rem;
    padding: 0.85rem 1rem;
    overflow-x: auto;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
}
.gallery-thumb {
    flex-shrink: 0;
    width: 72px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    background: none;
    opacity: 0.65;
    transition: opacity 0.2s, border-color 0.2s;
}
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumb.active, .gallery-thumb:hover { opacity: 1; border-color: var(--purple); }

.gallery-counter {
    text-align: center;
    font-size: 0.8rem;
    color: var(--gray-500);
    padding: 0 1rem 1rem;
    margin: 0;
}

.gallery-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 320px;
    color: var(--gray-500);
    gap: 0.75rem;
}
.gallery-empty .bi { font-size: 2.5rem; color: var(--purple); opacity: 0.4; }

.vehicle-info { background: var(--gray-100); padding: 1.5rem; border-radius: var(--radius); position: sticky; top: 90px; }
.price-box { text-align: center; padding: 1.25rem; background: var(--white); border-radius: var(--radius); margin-bottom: 1.25rem; }
.price-label { display: block; font-size: 0.85rem; color: var(--gray-500); }
.price-box .price { font-size: 2rem; display: block; }
.price-unit { font-size: 0.9rem; color: var(--gray-500); }
.feature-list { list-style: none; margin: 1rem 0; }
.feature-list li { padding: 0.35rem 0; padding-left: 1.25rem; position: relative; }
.feature-list li::before { content: '\2713'; position: absolute; left: 0; color: var(--gold-dark); font-weight: 700; }
.rate-table dl { margin-top: 0.75rem; }
.rate-table div { display: flex; justify-content: space-between; padding: 0.35rem 0; border-bottom: 1px solid var(--gray-200); }
.rate-table dt { color: var(--gray-500); }
.vehicle-description { margin-bottom: 1rem; }

/* Forms */
.form-container { max-width: 640px; }
.inquiry-form, .admin-form { display: flex; flex-direction: column; gap: 1rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.form-group { display: flex; flex-direction: column; gap: 0.35rem; }
.form-group label { font-weight: 600; font-size: 0.9rem; }
.form-group input, .form-group select, .form-group textarea {
    padding: 0.65rem 0.85rem; border: 1px solid var(--gray-200); border-radius: 8px;
    font: inherit; transition: border-color 0.2s;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--purple);
}
.checkbox { display: flex; align-items: center; gap: 0.5rem; font-size: 0.95rem; cursor: pointer; }
.filter-bar { display: flex; gap: 0.75rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.filter-bar input, .filter-bar select { padding: 0.55rem 0.85rem; border: 1px solid var(--gray-200); border-radius: 8px; font: inherit; }

/* Alerts */
.alert { padding: 0.85rem 1.25rem; margin: 1rem auto; max-width: 1200px; border-radius: 8px; font-weight: 500; }
.alert-success { background: #d4edda; color: #155724; }
.alert-error { background: #f8d7da; color: #721c24; }

/* Footer */
.site-footer { background: var(--dark); color: rgba(255,255,255,0.85); margin-top: 3rem; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 2rem; padding: 3rem 0; }
.footer-grid h4 { color: var(--gold); margin-bottom: 0.75rem; }
.footer-grid a { color: rgba(255,255,255,0.85); }
.footer-logo { height: 40px; margin-bottom: 1rem; filter: brightness(0) invert(1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding: 1rem 0; font-size: 0.85rem; opacity: 0.7; }

/* Login */
.login-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--gray-100); }
.login-card { background: var(--white); padding: 2.5rem; border-radius: var(--radius); box-shadow: var(--shadow); width: 100%; max-width: 400px; text-align: center; }
.login-logo { height: 60px; margin: 0 auto 1rem; }
.login-card h1 { color: var(--purple); margin-bottom: 1.5rem; }
.login-hint { font-size: 0.8rem; color: var(--gray-500); margin-top: 1rem; }

.empty-state { text-align: center; padding: 3rem; color: var(--gray-500); }

@media (max-width: 768px) {
    .hero-grid, .vehicle-detail-grid { grid-template-columns: 1fr; }
    .nav-toggle { display: block; }
    .nav-links { display: none; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0; background: var(--white); padding: 1rem; box-shadow: var(--shadow); }
    .nav-links.open { display: flex; }
    .vehicle-info { position: static; }
    .gallery-main-frame img { height: 280px; }
    .gallery-nav { width: 36px; height: 36px; }
}
