/* portal.css — Shared styles for all AmeriDex Dealer Portal pages */

:root {
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-soft: #eff6ff;
    --border-subtle: #e5e7eb;
    --text-main: #111827;
    --text-muted: #6b7280;
    --danger: #dc2626;
    --success: #16a34a;
    --warning: #f59e0b;
    --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
    --radius-card: 14px;
    --radius-field: 8px;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.5;
}

.page-shell { max-width: 1120px; margin: 0 auto; padding: 1.5rem 1.25rem 2.5rem; }
.app-hidden { display: none !important; }

header.app-header {
    background: linear-gradient(135deg, #2563eb, #1e40af);
    color: #fff;
    padding: 1.5rem 1.75rem;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
    box-shadow: var(--shadow-soft);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-brand { display: flex; align-items: center; gap: 1rem; }
header.app-header img { max-width: 160px; height: auto; }
.header-titles h1 { margin: 0; font-size: 1.4rem; letter-spacing: 0.02em; }
.header-titles .portal-badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}
.header-actions { display: flex; gap: 0.5rem; align-items: center; }
.header-dealer-info { font-size: 0.8rem; opacity: 0.9; margin-right: 0.5rem; }
.header-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-decoration: none;
}
.header-btn:hover { background: rgba(255,255,255,0.25); }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-card);
    padding: 1.75rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
    border: 1px solid rgba(148, 163, 184, 0.18);
}

.card-header {
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(229, 231, 235, 0.9);
    padding-bottom: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.card-title { margin: 0; font-size: 1.15rem; font-weight: 700; letter-spacing: 0.01em; }
.card-subtitle { margin: 0.2rem 0 0; font-size: 0.88rem; color: var(--text-muted); }

.btn {
    border-radius: 999px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    text-decoration: none;
}
.btn-primary { background-color: var(--primary); color: #ffffff; }
.btn-primary:hover { background-color: var(--primary-dark); }
.btn-outline { background-color: #ffffff; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background-color: var(--primary-soft); }
.btn-ghost { background-color: transparent; color: #374151; border-color: #d1d5db; }
.btn-ghost:hover { background-color: #f9fafb; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.85rem; }
.btn-xs { padding: 0.3rem 0.65rem; font-size: 0.75rem; }
.btn-success { background-color: var(--success); color: #ffffff; }
.btn-success:hover { background-color: #15803d; }

/* ── Mobile (< 768px) ─────────────────────────────────────── */
@media (max-width: 767px) {
    .page-shell { padding: 1rem 0.75rem 2rem; }

    header.app-header {
        padding: 1rem 1rem;
        flex-direction: column;
        text-align: center;
        border-radius: 0 0 10px 10px;
    }
    .header-brand { flex-direction: column; gap: 0.5rem; }
    header.app-header img { max-width: 120px; }
    .header-titles h1 { font-size: 1.15rem; }
    .header-actions { flex-wrap: wrap; justify-content: center; gap: 0.4rem; }
    .header-dealer-info { width: 100%; text-align: center; margin-right: 0; margin-bottom: 0.25rem; }
    .header-btn {
        padding: 0.6rem 1rem;
        font-size: 0.78rem;
        min-height: 44px;
        min-width: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .card { padding: 1.25rem 1rem; border-radius: 10px; }
    .card-header { flex-direction: column; align-items: flex-start; }

    .btn { min-height: 44px; min-width: 44px; }
    .btn-sm { padding: 0.6rem 1rem; min-height: 44px; }
    .btn-xs { padding: 0.45rem 0.75rem; font-size: 0.78rem; min-height: 44px; }

    /* iOS zoom prevention */
    input, select, textarea { font-size: 16px !important; }
}

/* ── Tablet (768px – 1024px) ──────────────────────────────── */
@media (min-width: 768px) and (max-width: 1024px) {
    .page-shell { padding: 1.25rem 1rem 2rem; }

    header.app-header { padding: 1.25rem 1.25rem; }
    header.app-header img { max-width: 140px; }

    .header-btn { min-height: 44px; }
    .btn { min-height: 44px; }
    .btn-sm { min-height: 44px; }
    .btn-xs { min-height: 44px; padding: 0.4rem 0.7rem; }
}
