/* =====================================================
   PG CARS MNE — Main Stylesheet
   Dark premium theme · Mobile-first
   ===================================================== */

/* --- Design tokens --- */
:root {
    /* Brand */
    --orange: #E8621A;
    --orange-bright: #FF7B2E;
    --orange-deep: #C24E0F;
    --orange-soft: rgba(232, 98, 26, 0.12);

    /* Neutrals */
    --bg: #0A0A0A;
    --bg-elev: #121212;
    --bg-card: #161616;
    --bg-input: #0E0E0E;
    --border: #242424;
    --border-strong: #353535;
    --border-orange: rgba(232, 98, 26, 0.4);

    /* Text */
    --text: #FFFFFF;
    --text-muted: #A0A0A0;
    --text-dim: #6B6B6B;

    /* Status */
    --status-available: #22C55E;
    --status-reserved: #EAB308;
    --status-incoming: #3B82F6;
    --status-sold: #EF4444;

    /* Effects */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-orange: 0 8px 32px rgba(232, 98, 26, 0.25);
    --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);

    /* Spacing & sizing */
    --radius-sm: 8px;
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    /* Layout */
    --header-h: 72px;
    --container: 1280px;
    --container-narrow: 1100px;
}

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

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    font-size: 16px;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

a {
    color: inherit;
    text-decoration: none;
    transition: color var(--transition);
}

button, input, select, textarea {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    background: none;
    border: none;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.5rem); }

.text-muted { color: var(--text-muted); }
.text-orange { color: var(--orange-bright); }

/* --- Containers --- */
.container {
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 20px;
}

.container-narrow {
    width: 100%;
    max-width: var(--container-narrow);
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Buttons --- */
.btn-primary,
.btn-secondary,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 24px;
    font-weight: 600;
    font-size: 15px;
    border-radius: var(--radius);
    transition: all var(--transition);
    border: 1px solid transparent;
    text-align: center;
    line-height: 1;
    white-space: nowrap;
    user-select: none;
}

.btn-primary {
    background: var(--orange);
    color: #fff;
}
.btn-primary:hover {
    background: var(--orange-bright);
    box-shadow: var(--shadow-orange);
    transform: translateY(-1px);
}
.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: transparent;
    color: var(--text);
    border-color: var(--border-strong);
}
.btn-secondary:hover {
    border-color: var(--orange);
    color: var(--orange-bright);
}

.btn-ghost {
    background: transparent;
    color: var(--text-muted);
}
.btn-ghost:hover {
    color: var(--orange-bright);
    background: var(--orange-soft);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 10px 16px;
    font-size: 14px;
}

.btn-lg {
    padding: 18px 32px;
    font-size: 16px;
}

/* --- Form fields --- */
.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.field input,
.field select,
.field textarea {
    width: 100%;
    padding: 13px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 15px;
    transition: border-color var(--transition), background var(--transition);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
    outline: none;
    border-color: var(--orange);
    background: #131313;
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--text-dim);
}

.field textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* --- Status badges --- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-available { background: rgba(34, 197, 94, 0.15); color: var(--status-available); }
.badge-reserved  { background: rgba(234, 179, 8, 0.15);  color: var(--status-reserved); }
.badge-incoming  { background: rgba(59, 130, 246, 0.15); color: var(--status-incoming); }
.badge-sold      { background: rgba(239, 68, 68, 0.15);  color: var(--status-sold); }

/* --- Cards --- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    transition: border-color var(--transition), transform var(--transition);
    overflow: hidden;
}

.card:hover {
    border-color: var(--border-orange);
}

/* --- Utilities --- */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; }
.gap-12 { gap: 12px; }
.gap-16 { gap: 16px; }
.gap-24 { gap: 24px; }
.hidden { display: none !important; }
.text-center { text-align: center; }

/* --- Scrollbar (subtle) --- */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--border);
    border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--orange);
}

/* --- Selection --- */
::selection {
    background: var(--orange);
    color: #fff;
}

/* --- Loading spinner --- */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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