:root {
    --bg: #0f172a;
    --bg-card: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --accent: #0ea5e9;
    --accent-dark: #0284c7;
    --jet: #dc2626;
    --imile: #2563eb;
    --green: #16a34a;
    --nav-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

body.motorista-app {
    margin: 0;
    min-height: 100dvh;
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 220px, #f1f5f9 220px);
    font-family: "Inter", system-ui, -apple-system, sans-serif;
    color: var(--text);
}

.m-header {
    padding: max(16px, env(safe-area-inset-top)) 16px 0;
    color: #fff;
}

.m-header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}

.m-greeting {
    font-size: 14px;
    opacity: .85;
    margin: 0 0 4px;
}

.m-name {
    font-size: 22px;
    font-weight: 800;
    margin: 0;
    line-height: 1.2;
}

.m-carrier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.2);
}

.m-carrier-badge.jet { background: rgba(220,38,38,.25); }
.m-carrier-badge.imile { background: rgba(37,99,235,.35); }
.m-carrier-badge.vehicle { background: rgba(255,255,255,.2); margin-left: 6px; }

.m-logout {
    color: #fff;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    white-space: nowrap;
}

.m-main {
    padding: 16px;
    max-width: 480px;
    margin: 0 auto;
}

.m-hero {
    background: var(--bg-card);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 12px 40px rgba(15,23,42,.18);
    border: 1px solid #e2e8f0;
    margin-bottom: 16px;
}

.m-hero-label {
    font-size: 13px;
    color: var(--muted);
    font-weight: 600;
    margin: 0 0 4px;
}

.m-hero-period {
    font-size: 14px;
    color: #475569;
    margin: 0 0 16px;
}

.m-hero-amount {
    font-size: 40px;
    font-weight: 800;
    color: var(--green);
    line-height: 1;
    margin: 0 0 8px;
    letter-spacing: -.02em;
}

.m-hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
}

.m-pill {
    background: #f1f5f9;
    padding: 6px 10px;
    border-radius: 999px;
    font-weight: 600;
}

.m-pill.pay { background: #dbeafe; color: #1d4ed8; }

.m-today {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 14px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    text-decoration: none;
    color: inherit;
}

.m-today:active { background: #f8fafc; }

.m-today-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.m-today-value { font-size: 18px; font-weight: 800; color: var(--accent); }

.m-actions { display: grid; gap: 10px; margin-bottom: 16px; }

.m-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 14px 18px;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    width: 100%;
    -webkit-tap-highlight-color: transparent;
}

.m-btn-primary {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(14,165,233,.35);
}

.m-btn-primary:active { background: var(--accent-dark); }

.m-btn-secondary {
    background: #fff;
    color: #0369a1;
    border: 2px solid #bae6fd;
}

.m-btn-ghost {
    background: transparent;
    color: var(--muted);
    font-size: 14px;
    min-height: 44px;
}

.m-note {
    text-align: center;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    padding: 0 8px;
}

.m-bottom-nav-spacer {
    height: calc(var(--nav-h) + var(--safe-b) + 16px);
    pointer-events: none;
}

.m-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(var(--nav-h) + var(--safe-b));
    padding-bottom: var(--safe-b);
    background: #fff;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-around;
    align-items: center;
    z-index: 100;
    max-width: 480px;
    margin: 0 auto;
    box-shadow: 0 -4px 20px rgba(0,0,0,.06);
}

@media (min-width: 481px) and (max-width: 767px) {
    .m-bottom-nav {
        left: 50%;
        transform: translateX(-50%);
        border-radius: 16px 16px 0 0;
    }
}

@media (min-width: 768px) {
    .m-bottom-nav-spacer {
        display: none;
    }

    .m-bottom-nav {
        position: static;
        left: auto;
        right: auto;
        transform: none;
        width: calc(100% - 32px);
        max-width: 1120px;
        height: auto;
        min-height: var(--nav-h);
        margin: 32px auto 24px;
        padding: 8px 12px calc(8px + var(--safe-b));
        border: 1px solid #e2e8f0;
        border-radius: 16px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    }

    .m-nav-item {
        min-height: 48px;
        font-size: 12px;
    }
}

.m-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    text-decoration: none;
    color: var(--muted);
    font-size: 11px;
    font-weight: 600;
    min-height: 52px;
    padding: 4px;
}

.m-nav-item .icon { font-size: 20px; line-height: 1; }

.m-nav-item.active { color: var(--accent); }

/* Login / seletor transportadora */
.auth-app {
    margin: 0;
    min-height: 100dvh;
    background: linear-gradient(165deg, #0f172a 0%, #1e40af 100%);
    font-family: "Inter", system-ui, sans-serif;
    color: #1e293b;
    display: flex;
    flex-direction: column;
    padding: max(20px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
}

.auth-shell {
    width: 100%;
    max-width: 420px;
    margin: auto;
}

.auth-brand {
    text-align: center;
    color: #fff;
    margin-bottom: 24px;
}

.auth-logo {
    display: block;
    width: min(280px, 78vw);
    height: auto;
    margin: 0 auto 16px;
    border-radius: 20px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
}

.auth-brand h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 6px;
}

.auth-brand p {
    margin: 0;
    font-size: 14px;
    opacity: .88;
    line-height: 1.45;
}

.auth-card {
    background: #fff;
    border-radius: 20px;
    padding: 24px 20px;
    box-shadow: 0 20px 50px rgba(0,0,0,.2);
}

.auth-error {
    background: #fee2e2;
    color: #b91c1c;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 16px;
    font-size: 14px;
}

.auth-field { margin-bottom: 16px; text-align: left; }

.auth-field label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.auth-field input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.auth-field input:focus {
    outline: none;
    border-color: #38bdf8;
    background: #fff;
}

.auth-submit {
    width: 100%;
    min-height: 52px;
    border: none;
    border-radius: 14px;
    background: #0ea5e9;
    color: #fff;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-top: 4px;
}

.auth-submit:active { background: #0284c7; }

.auth-footer {
    text-align: center;
    margin-top: 20px;
    font-size: 12px;
    color: rgba(255,255,255,.7);
}

.carrier-pick { display: grid; gap: 12px; }

.carrier-btn {
    display: block;
    width: 100%;
    text-align: left;
    padding: 18px 16px;
    border-radius: 16px;
    border: 2px solid #e2e8f0;
    background: #f8fafc;
    cursor: pointer;
    transition: .15s;
}

.carrier-btn:active { transform: scale(.98); }

.carrier-btn.jet { border-color: #fecaca; }
.carrier-btn.imile { border-color: #bfdbfe; }

.carrier-btn h2 {
    margin: 0 0 4px;
    font-size: 18px;
}

.carrier-btn.jet h2 { color: var(--jet); }
.carrier-btn.imile h2 { color: var(--imile); }

.carrier-btn p {
    margin: 0;
    font-size: 13px;
    color: var(--muted);
}

.auth-link {
    display: block;
    text-align: center;
    margin-top: 16px;
    color: #64748b;
    font-size: 14px;
}

.m-back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #0369a1;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 12px;
}

@media (min-width: 768px) {
    .m-hero-amount { font-size: 48px; }
    .m-main { max-width: 520px; }
}
