/* =========================================================
   Thanasup Leasing & Finance — Design System 2026
   Modern Finance · Mobile-First · Accessible
   ========================================================= */

/* ---------- 1. Design Tokens ---------- */
:root {
    /* Brand Colors */
    --brand-900: #071D46;
    --brand-800: #0A3A7A;
    --brand-700: #0052CC;
    --brand-600: #1A6FE8;
    --brand-500: #2684FF;
    --brand-400: #4DA3FF;
    --brand-300: #85C1FF;
    --brand-200: #B3D9FF;
    --brand-100: #E3F0FF;
    --brand-50:  #F5FAFF;

    /* Accent */
    --accent-cyan: #00C2FF;
    --accent-gold: #F5C76E;
    --accent-green: #36B37E;
    --accent-red: #FF5630;

    /* Neutral / Ink */
    --ink-900: #0F172A;
    --ink-800: #1E293B;
    --ink-700: #334155;
    --ink-600: #475569;
    --ink-500: #64748B;
    --ink-400: #94A3B8;
    --ink-300: #CBD5E1;
    --ink-200: #E2E8F0;
    --ink-100: #F1F5F9;
    --ink-50:  #F8FAFC;

    /* Surfaces */
    --surface-page: var(--brand-50);
    --surface-card: rgba(255, 255, 255, 0.95);
    --surface-glass: rgba(255, 255, 255, 0.72);
    --surface-dark: var(--brand-900);

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #071D46 0%, #0A3A7A 40%, #0052CC 100%);
    --gradient-hero: linear-gradient(145deg, #071D46 0%, #0A3A7A 35%, #1A6FE8 75%, #2684FF 100%);
    --gradient-cta: linear-gradient(135deg, #0052CC 0%, #2684FF 100%);
    --gradient-page: radial-gradient(ellipse at top left, rgba(38, 132, 255, 0.08), transparent 50%),
                     radial-gradient(ellipse at bottom right, rgba(0, 194, 255, 0.05), transparent 50%),
                     linear-gradient(180deg, #F5FAFF 0%, #FFFFFF 100%);
    --gradient-glow: radial-gradient(circle, rgba(38, 132, 255, 0.15), transparent 70%);

    /* Shadows */
    --shadow-xs: 0 1px 2px rgba(7, 29, 70, 0.05);
    --shadow-sm: 0 4px 12px rgba(7, 29, 70, 0.06);
    --shadow-md: 0 8px 24px rgba(7, 29, 70, 0.08);
    --shadow-lg: 0 16px 40px rgba(7, 29, 70, 0.10);
    --shadow-xl: 0 24px 56px rgba(7, 29, 70, 0.12);
    --shadow-glow: 0 8px 32px rgba(0, 82, 204, 0.20);
    --shadow-card: 0 2px 8px rgba(7, 29, 70, 0.04), 0 8px 24px rgba(7, 29, 70, 0.06);

    /* Border */
    --border-light: 1px solid rgba(7, 29, 70, 0.06);
    --border-medium: 1px solid rgba(7, 29, 70, 0.10);
    --border-accent: 1px solid rgba(0, 82, 204, 0.15);

    /* Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;
    --radius-pill: 999px;

    /* Typography */
    --font-primary: 'Noto Sans Lao', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    --text-3xl: 1.875rem;
    --text-4xl: 2.25rem;
    --text-5xl: 3rem;
    --text-6xl: 3.75rem;

    --leading-tight: 1.15;
    --leading-snug: 1.3;
    --leading-normal: 1.6;
    --leading-relaxed: 1.8;

    /* Spacing */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;

    /* Layout */
    --container-max: 1200px;
    --container-narrow: 900px;
    --container-wide: 1400px;
    --nav-height: 80px;
    --section-py: clamp(3rem, 8vw, 6rem);

    /* Motion */
    --ease-out: cubic-bezier(0.2, 0.8, 0.2, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --duration-fast: 150ms;
    --duration-base: 250ms;
    --duration-slow: 400ms;
    --duration-slower: 600ms;
    --transition-base: var(--duration-base) var(--ease-out);
    --transition-fast: var(--duration-fast) var(--ease-out);
    --transition-slow: var(--duration-slow) var(--ease-out);

    /* Z-index */
    --z-dropdown: 100;
    --z-sticky: 500;
    --z-navbar: 1000;
    --z-modal: 2000;
    --z-tooltip: 3000;
}


/* ---------- 2. Reset & Base ---------- */

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-height) + 1rem);
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    font-family: var(--font-primary);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--ink-800);
    background: var(--gradient-page);
    min-height: 100vh;
    padding-top: var(--nav-height);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

body.popup-open,
body.modal-open {
    overflow: hidden;
}

::selection {
    background: rgba(38, 132, 255, 0.18);
    color: var(--ink-900);
}

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

a {
    color: var(--brand-700);
    text-decoration: none;
    transition: color var(--transition-fast), opacity var(--transition-fast);
}

a:hover {
    color: var(--brand-600);
}

ul, ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

hr {
    border: 0;
    border-top: 1px solid var(--ink-200);
    margin: var(--space-8) 0;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
    border: none;
    outline: none;
    background: none;
}


/* ---------- 3. Typography ---------- */

h1, h2, h3, h4, h5, h6 {
    color: var(--ink-900);
    font-weight: 700;
    line-height: var(--leading-tight);
    letter-spacing: -0.02em;
    margin-bottom: var(--space-4);
}

h1 { font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl)); }
h2 { font-size: clamp(var(--text-2xl), 4vw, var(--text-4xl)); }
h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); }
h4 { font-size: clamp(var(--text-lg), 2.5vw, var(--text-xl)); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-base); }

p {
    color: var(--ink-600);
    line-height: var(--leading-relaxed);
    margin-bottom: var(--space-4);
}

p:last-child { margin-bottom: 0; }

.text-sm { font-size: var(--text-sm); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-muted { color: var(--ink-500); }
.text-brand { color: var(--brand-700); }
.text-white { color: #fff; }
.text-gold { color: var(--accent-gold); }

.section-label {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    font-size: var(--text-sm);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-600);
    margin-bottom: var(--space-3);
}

.section-label::before {
    content: '';
    width: 2rem;
    height: 2px;
    background: var(--gradient-cta);
    border-radius: var(--radius-pill);
}

.section-title {
    margin-bottom: var(--space-4);
}

.section-subtitle {
    font-size: clamp(var(--text-base), 2vw, var(--text-lg));
    color: var(--ink-500);
    max-width: 640px;
    line-height: var(--leading-relaxed);
}


/* ---------- 4. Layout ---------- */

.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-5);
}

.container--narrow {
    max-width: var(--container-narrow);
}

.container--wide {
    max-width: var(--container-wide);
}

.section {
    padding-block: var(--section-py);
    position: relative;
}

.section--dark {
    background: var(--gradient-brand);
    color: #fff;
}

.section--dark h2,
.section--dark h3,
.section--dark h4,
.section--dark p {
    color: #fff;
}

.section--dark p {
    color: rgba(255, 255, 255, 0.78);
}

.section--gray {
    background: var(--ink-50);
}

.grid {
    display: grid;
    gap: var(--space-6);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 640px) {
    .grid--2 { grid-template-columns: repeat(2, 1fr); }
    .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
    .grid--3 { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }


/* ---------- 5. Buttons ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: 0.85rem 1.75rem;
    font-size: var(--text-base);
    font-weight: 700;
    border-radius: var(--radius-pill);
    cursor: pointer;
    transition: all var(--transition-base);
    white-space: nowrap;
    border: 2px solid transparent;
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.12), transparent);
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.btn:hover::after {
    opacity: 1;
}

.btn--primary {
    background: var(--gradient-cta);
    color: #fff;
    box-shadow: var(--shadow-glow);
}

.btn--primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(0, 82, 204, 0.30);
    color: #fff;
}

.btn--secondary {
    background: var(--surface-card);
    color: var(--brand-700);
    border-color: rgba(0, 82, 204, 0.15);
    box-shadow: var(--shadow-sm);
}

.btn--secondary:hover {
    background: var(--brand-100);
    border-color: var(--brand-300);
    transform: translateY(-2px);
    color: var(--brand-700);
}

.btn--outline {
    background: transparent;
    color: #fff;
    border-color: rgba(255, 255, 255, 0.35);
}

.btn--outline:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    color: #fff;
}

.btn--ghost {
    background: transparent;
    color: var(--brand-700);
    padding: 0.7rem 1rem;
}

.btn--ghost:hover {
    background: var(--brand-100);
}

.btn--lg {
    padding: 1.1rem 2.25rem;
    font-size: var(--text-lg);
}

.btn--sm {
    padding: 0.6rem 1.2rem;
    font-size: var(--text-sm);
}

.btn--icon {
    width: 3rem;
    height: 3rem;
    padding: 0;
    border-radius: 50%;
}

.btn i, .btn svg {
    font-size: 1.1em;
}


/* ---------- 6. Cards ---------- */

.card {
    background: var(--surface-card);
    border-radius: var(--radius-xl);
    border: var(--border-light);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(0, 82, 204, 0.12);
}

.card__img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.card__body {
    padding: var(--space-6);
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card__title {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ink-900);
    margin-bottom: var(--space-2);
}

.card__text {
    color: var(--ink-600);
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    flex: 1;
}

.card--glass {
    background: var(--surface-glass);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

.card--service {
    text-align: center;
    padding: var(--space-8) var(--space-6);
}

.card--service .card__icon {
    width: 4rem;
    height: 4rem;
    margin: 0 auto var(--space-5);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--brand-100);
    color: var(--brand-700);
    font-size: 1.5rem;
}


/* ---------- 7. Forms ---------- */

.form-group {
    margin-bottom: var(--space-5);
}

.form-label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--ink-700);
    margin-bottom: var(--space-2);
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 0.9rem 1rem;
    font-size: var(--text-base);
    background: var(--ink-50);
    border: 1.5px solid var(--ink-200);
    border-radius: var(--radius-lg);
    color: var(--ink-900);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    background: #fff;
    border-color: var(--brand-500);
    box-shadow: 0 0 0 3px rgba(38, 132, 255, 0.12);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--ink-400);
}

.form-textarea {
    min-height: 8rem;
    resize: vertical;
}

.form-error {
    font-size: var(--text-sm);
    color: var(--accent-red);
    margin-top: var(--space-1);
    display: none;
}

.form-group.has-error .form-input,
.form-group.has-error .form-textarea {
    border-color: var(--accent-red);
}

.form-group.has-error .form-error {
    display: block;
}

.form-note {
    font-size: var(--text-sm);
    color: var(--ink-500);
    margin-top: var(--space-6);
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
}


/* ---------- 8. Badge / Tag ---------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 700;
    border-radius: var(--radius-pill);
    background: var(--brand-100);
    color: var(--brand-700);
}

.badge--success {
    background: rgba(54, 179, 126, 0.12);
    color: var(--accent-green);
}

.badge--gold {
    background: rgba(245, 199, 110, 0.18);
    color: #B8860B;
}


/* ---------- 9. Focus & Accessibility ---------- */

.skip-link,
.site-skip-link {
    position: fixed;
    top: var(--space-4);
    left: var(--space-4);
    z-index: 10000;
    padding: var(--space-3) var(--space-5);
    border-radius: var(--radius-pill);
    background: var(--brand-900);
    color: #fff;
    font-weight: 700;
    box-shadow: var(--shadow-lg);
    transform: translateY(-200%);
    transition: transform var(--transition-base);
}

.skip-link:focus-visible,
.site-skip-link:focus-visible {
    transform: translateY(0);
}

*:focus-visible {
    outline: 3px solid var(--brand-500);
    outline-offset: 3px;
}

button:focus-visible,
.btn:focus-visible {
    outline-offset: 4px;
}


/* ---------- 10. Animations ---------- */

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(24px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-24px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

.animate-fade-in-up {
    animation: fadeInUp var(--duration-slow) var(--ease-out) both;
}

.animate-fade-in {
    animation: fadeIn var(--duration-slow) var(--ease-out) both;
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity var(--duration-slower) var(--ease-out), transform var(--duration-slower) var(--ease-out);
}

.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}

.stagger-1 { transition-delay: 0.05s; }
.stagger-2 { transition-delay: 0.10s; }
.stagger-3 { transition-delay: 0.15s; }
.stagger-4 { transition-delay: 0.20s; }
.stagger-5 { transition-delay: 0.25s; }
.stagger-6 { transition-delay: 0.30s; }


/* ---------- 11. Utility ---------- */

.mx-auto { margin-inline: auto; }
.mb-0 { margin-bottom: 0; }
.mb-4 { margin-bottom: var(--space-4); }
.mb-6 { margin-bottom: var(--space-6); }
.mb-8 { margin-bottom: var(--space-8); }
.mt-4 { margin-top: var(--space-4); }
.mt-8 { margin-top: var(--space-8); }
.pt-0 { padding-top: 0; }
.pb-0 { padding-bottom: 0; }

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hidden { display: none !important; }

.rounded { border-radius: var(--radius-lg); }
.rounded-xl { border-radius: var(--radius-xl); }
.rounded-full { border-radius: 50%; }


/* ---------- 12. Responsive ---------- */

@media (min-width: 768px) {
    .container {
        padding-inline: var(--space-8);
    }
}

@media (min-width: 1024px) {
    :root {
        --nav-height: 88px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }

    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}