/*
 * Autofie Global Design System v2
 * --------------------------------
 * Primary:    #16A34A
 * Accent:     #2563EB
 * White:      #FFFFFF
 * Section:    #F9FAFB
 * Heading:    #111827
 * Body:       #4B5563
 * Muted:      #6B7280
 * Border:     #E5E7EB
 * --------------------------------
 * Font:       Inter (loaded below)
 * Base size:  14px / line-height 1.6
 */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

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

html { font-size: 14px; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    line-height: 1.6;
    color: #4B5563;
    background: #FFFFFF;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Typography ─────────────────────── */
h1, h2, h3, h4, h5, h6 {
    color: #111827;
    font-weight: 600;
    line-height: 1.25;
}

h1 { font-size: 28px; }
h2 { font-size: 20px; }
h3 { font-size: 16px; }
h4 { font-size: 14px; }

p {
    font-size: 14px;
    color: #4B5563;
    line-height: 1.65;
}

a { color: #16A34A; text-decoration: none; }
a:hover { color: #15803D; }

small, .text-sm { font-size: 12px; color: #6B7280; }

.text-muted { color: #6B7280; }
.text-heading { color: #111827; }
.text-primary { color: #16A34A; }
.text-accent { color: #2563EB; }

/* ── Layout ─────────────────────────── */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ── Navigation ─────────────────────── */
.site-header,
.ast-primary-header-bar,
#masthead {
    background: #FFFFFF !important;
    border-bottom: 1px solid #E5E7EB !important;
    box-shadow: none !important;
}

.main-navigation a,
.ast-builder-menu a,
.menu-item > a,
.nav-link {
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: #111827 !important;
    letter-spacing: 0 !important;
    text-decoration: none !important;
}

.main-navigation a:hover,
.ast-builder-menu a:hover,
.menu-item > a:hover {
    color: #16A34A !important;
}

.ast-site-identity .site-title a,
.site-title a {
    font-weight: 600 !important;
    font-size: 18px !important;
    color: #111827 !important;
    letter-spacing: -0.02em !important;
}

/* ── Buttons ─────────────────────────── */
.btn,
.button,
input[type="submit"],
button[type="submit"] {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    cursor: pointer;
    border: 1px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: #16A34A;
    color: #FFFFFF;
    border-color: #16A34A;
}
.btn-primary:hover { background: #15803D; border-color: #15803D; color: #FFFFFF; }

.btn-accent {
    background: #2563EB;
    color: #FFFFFF;
    border-color: #2563EB;
}
.btn-accent:hover { background: #1D4ED8; border-color: #1D4ED8; color: #FFFFFF; }

.btn-outline {
    background: #FFFFFF;
    color: #111827;
    border-color: #E5E7EB;
}
.btn-outline:hover { background: #F9FAFB; }

.btn:disabled,
button:disabled { opacity: 0.5; cursor: not-allowed; pointer-events: none; }

/* ── Form Elements ───────────────────── */
input[type="text"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="password"],
input[type="search"],
select,
textarea {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #111827;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 13px;
    width: 100%;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    appearance: none;
    -webkit-appearance: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #16A34A;
    box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.12);
}

input[readonly],
input[disabled],
select[disabled] {
    background: #F9FAFB;
    color: #6B7280;
    cursor: not-allowed;
}

label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
    margin-bottom: 5px;
}

select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

/* ── Cards ───────────────────────────── */
.card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 20px 24px;
}

.card-sm { padding: 16px; }

/* ── Badges & Tags ───────────────────── */
.badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 20px;
    line-height: 1.5;
    white-space: nowrap;
}

.badge-green  { background: #F0FDF4; color: #15803D; border: 1px solid #86EFAC; }
.badge-blue   { background: #EFF6FF; color: #1D4ED8; border: 1px solid #BFDBFE; }
.badge-yellow { background: #FEFCE8; color: #A16207; border: 1px solid #FEF08A; }
.badge-red    { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }
.badge-gray   { background: #F9FAFB; color: #4B5563; border: 1px solid #E5E7EB; }

/* ── Alerts ──────────────────────────── */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    border-width: 1px;
    border-style: solid;
}
.alert-success { background: #F0FDF4; color: #15803D; border-color: #86EFAC; }
.alert-error   { background: #FEF2F2; color: #DC2626; border-color: #FECACA; }
.alert-info    { background: #EFF6FF; color: #1D4ED8; border-color: #BFDBFE; }
.alert-warning { background: #FEFCE8; color: #A16207; border-color: #FEF08A; }

/* ── Divider ─────────────────────────── */
hr {
    border: none;
    border-top: 1px solid #E5E7EB;
    margin: 20px 0;
}

/* ── Section backgrounds ─────────────── */
.section-gray { background: #F9FAFB; }
.section-white { background: #FFFFFF; }

/* ── Popup ───────────────────────────── */
.autofie-overlay { background: rgba(0,0,0,0.5); }

.autofie-modal {
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

.autofie-title {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 20px;
}

.autofie-input {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #111827;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 10px 13px;
    margin-bottom: 12px;
}

.autofie-input:focus { border-color: #16A34A; box-shadow: 0 0 0 3px rgba(22,163,74,0.12); }

.autofie-google-btn {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    color: #111827;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
}
.autofie-google-btn:hover { background: #F9FAFB; color: #111827; }

.autofie-facebook-btn {
    background: #2563EB;
    color: #FFFFFF;
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 500;
    border-radius: 8px;
}
.autofie-facebook-btn:hover { background: #1D4ED8; }

.autofie-submit-btn {
    background: #16A34A !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    border: none !important;
}
.autofie-submit-btn:hover { background: #15803D !important; }

.autofie-otp-btn {
    background: #16A34A !important;
    border-radius: 8px !important;
    border: none !important;
}
.autofie-otp-btn:hover { background: #15803D !important; }

.autofie-divider::before,
.autofie-divider::after { background: #E5E7EB; }
.autofie-divider span { color: #6B7280; font-size: 12px; }

.autofie-switch { font-size: 13px; color: #6B7280; }
.autofie-switch a { color: #16A34A; font-weight: 500; }

.autofie-dealer-box {
    background: #F0FDF4;
    border: 1px solid #86EFAC;
    border-radius: 8px;
}

/* ── Become Dealer Banner ────────────── */
#autofie-dealer-banner {
    background: #111827 !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 14px !important;
}

#autofie-become-dealer-btn {
    background: #16A34A !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}
#autofie-become-dealer-btn:hover { background: #15803D !important; }

/* ── Submit Listing Form ─────────────── */
.sl-wrap { font-family: 'Inter', sans-serif; }

.sl-tabs {
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    padding: 5px;
}

.sl-tab {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    color: #4B5563;
    border-radius: 7px;
    border: none;
}

.sl-tab.active,
.sl-tab:hover {
    background: #FFFFFF !important;
    color: #16A34A !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08) !important;
}

.sl-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    padding: 24px;
}

.sl-card h2 {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    border-bottom: 1px solid #F3F4F6;
    padding-bottom: 12px;
    margin-bottom: 18px;
}

.sl-field label {
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

.sl-field input,
.sl-field select,
.sl-field textarea,
.sl-field-select {
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #111827;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
}

.sl-field input:focus,
.sl-field select:focus,
.sl-field textarea:focus,
.sl-field-select:focus {
    border-color: #16A34A !important;
    box-shadow: 0 0 0 3px rgba(22,163,74,0.12) !important;
}

.sl-submit-btn {
    background: #16A34A !important;
    font-family: 'Inter', sans-serif !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
    letter-spacing: 0 !important;
}
.sl-submit-btn:hover { background: #15803D !important; }

.sl-add-btn:hover {
    border-color: #16A34A !important;
    color: #16A34A !important;
}

.sl-feature-item { border: 1px solid #E5E7EB; font-size: 13px; color: #374151; }
.sl-feature-item:has(input:checked) { border-color: #16A34A; background: #F0FDF4; color: #15803D; }
.sl-feature-item input { accent-color: #16A34A; }

/* ── Browse Page ─────────────────────── */
.br-page { font-family: 'Inter', sans-serif; }

.br-filters h3 { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600; }

.br-filter-group label {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    font-weight: 600;
    color: #6B7280;
    letter-spacing: 0.06em;
}

.br-apply-btn {
    background: #16A34A !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}
.br-apply-btn:hover { background: #15803D !important; }

.br-card { border: 1px solid #E5E7EB; border-radius: 12px; }
.br-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.07); }

.br-card-title { font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 500; color: #111827; }
.br-card-price { font-family: 'Inter', sans-serif; font-size: 17px; font-weight: 600; color: #16A34A; }

.br-cat-link {
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    color: #4B5563;
}
.br-cat-link:hover,
.br-cat-link.active {
    background: #16A34A !important;
    color: #FFFFFF !important;
    border-color: #16A34A !important;
}

.br-pagination a:hover { border-color: #16A34A; color: #16A34A; }
.br-pagination .current { background: #16A34A; border-color: #16A34A; }

/* ── Single Listing ──────────────────── */
.sl-page { font-family: 'Inter', sans-serif; }
.sl-title { font-size: 24px; font-weight: 600; color: #111827; }
.sl-price { font-size: 26px; font-weight: 600; color: #16A34A; }

.sl-wa-btn {
    background: #16A34A !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}
.sl-wa-btn:hover { background: #15803D !important; }

.sl-chat-btn {
    background: #2563EB !important;
    font-family: 'Inter', sans-serif !important;
    font-weight: 500 !important;
    border-radius: 8px !important;
}
.sl-chat-btn:hover { background: #1D4ED8 !important; }

.sl-specs { background: #F9FAFB; border-radius: 12px; }
.sl-spec-label { font-size: 11px; color: #6B7280; text-transform: uppercase; letter-spacing: 0.05em; font-weight: 500; }
.sl-spec-value { font-size: 14px; color: #111827; font-weight: 500; }

.sl-feature-tag {
    font-family: 'Inter', sans-serif;
    font-size: 12px;
    font-weight: 500;
    background: #F0FDF4;
    color: #15803D;
    border: 1px solid #86EFAC;
    border-radius: 20px;
    padding: 4px 12px;
}

/* ── My Listings ─────────────────────── */
.ml-wrap { font-family: 'Inter', sans-serif; }
.ml-post-btn { background: #16A34A !important; color: #FFFFFF !important; font-family: 'Inter', sans-serif !important; font-weight: 500 !important; border-radius: 8px !important; }
.ml-post-btn:hover { background: #15803D !important; }
.ml-badge.approved { background: #F0FDF4; color: #15803D; border: 1px solid #86EFAC; }
.ml-badge.pending  { background: #FEFCE8; color: #A16207; border: 1px solid #FEF08A; }
.ml-badge.rejected { background: #FEF2F2; color: #DC2626; border: 1px solid #FECACA; }

/* ── Dealer Profile ──────────────────── */
.dp-wrap { font-family: 'Inter', sans-serif; }
.dp-card h2 { font-size: 15px; font-weight: 600; color: #111827; }
.dp-submit-btn { background: #16A34A !important; font-family: 'Inter', sans-serif !important; font-weight: 500 !important; border-radius: 8px !important; }
.dp-submit-btn:hover { background: #15803D !important; }
.dp-field input:focus, .dp-field select:focus { border-color: #16A34A !important; box-shadow: 0 0 0 3px rgba(22,163,74,0.12) !important; }
.dp-upload-area:hover { border-color: #16A34A !important; }
.dp-individual-note { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1D4ED8; border-radius: 8px; }

/* ── WP Admin Overrides ──────────────── */
#wpadminbar { font-family: 'Inter', sans-serif !important; }
.wp-core-ui .button-primary { background: #16A34A !important; border-color: #15803D !important; font-family: 'Inter', sans-serif !important; }
.wp-core-ui .button-primary:hover { background: #15803D !important; }

/* ── Responsive ──────────────────────── */
@media (max-width: 768px) {
    h1 { font-size: 22px; }
    h2 { font-size: 18px; }
    .autofie-modal { padding: 24px 18px; border-radius: 12px; }
}
