/* ==========================================================================
   ACHADOS E PERDIDOS - Standalone Mobile App CSS
   Design Premium 2026 - Mobile First
   ========================================================================== */

/* ---------- CSS Custom Properties ---------- */
:root {
    /* Cores do App */
    --app-primary: #2563eb;
    --app-primary-dark: #1d4ed8;
    --app-success: #16a34a;
    --app-success-light: #22c55e;
    --app-danger: #dc2626;
    --app-danger-light: #ef4444;
    --app-warning: #f59e0b;

    /* Superfícies */
    --app-bg: #f8fafc;
    --app-surface: #ffffff;
    --app-surface-elevated: #ffffff;
    --app-border: #e2e8f0;

    /* Texto */
    --app-text: #0f172a;
    --app-text-secondary: #64748b;
    --app-text-muted: #94a3b8;

    /* Dimensões */
    --app-header-height: 56px;
    --app-bottom-nav-height: 64px;
    --app-safe-area-bottom: env(safe-area-inset-bottom, 0px);
    --app-radius: 16px;
    --app-radius-sm: 12px;
    --app-radius-xs: 8px;

    /* Espaçamentos */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;

    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-xl: 0 20px 50px rgba(0, 0, 0, 0.15);
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--app-bg);
    color: var(--app-text);
    line-height: 1.5;
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    padding-top: var(--app-header-height);
    padding-bottom: calc(var(--app-bottom-nav-height) + var(--app-safe-area-bottom));
}

/* ---------- App Header ---------- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--app-header-height);
    background: var(--app-surface);
    border-bottom: 1px solid var(--app-border);
    z-index: 100;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.app-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 var(--space-md);
    max-width: 600px;
    margin: 0 auto;
}

.app-logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.app-logo-img {
    height: 32px;
    width: auto;
    object-fit: contain;
    border-radius: 4px;
}

.app-logo-text {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--app-text);
}

.app-back-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    color: var(--app-text);
    text-decoration: none;
    transition: background 0.2s ease;
}

.app-back-btn:active {
    background: var(--app-border);
}

/* ---------- Main Content ---------- */
.app-main {
    min-height: calc(100vh - var(--app-header-height) - var(--app-bottom-nav-height));
    min-height: calc(100dvh - var(--app-header-height) - var(--app-bottom-nav-height));
    padding: var(--space-md);
    max-width: 600px;
    margin: 0 auto;
}

/* ---------- Messages ---------- */
.app-messages {
    margin-bottom: var(--space-md);
}

.app-message {
    padding: var(--space-md);
    border-radius: var(--app-radius-sm);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.app-message-success {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.app-message-error {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    color: #991b1b;
    border: 1px solid #fecaca;
}

.app-message-warning {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    color: #92400e;
    border: 1px solid #fcd34d;
}

.app-message-info {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    color: #1e40af;
    border: 1px solid #93c5fd;
}

/* ---------- Bottom Navigation (Tab Bar) ---------- */
.app-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--app-bottom-nav-height) + var(--app-safe-area-bottom));
    background: var(--app-surface);
    border-top: 1px solid var(--app-border);
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: var(--space-sm);
    padding-bottom: var(--app-safe-area-bottom);
    z-index: 100;
}

.app-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: var(--space-xs) var(--space-md);
    color: var(--app-text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border-radius: var(--app-radius-xs);
    min-width: 64px;
}

.app-nav-item svg {
    width: 24px;
    height: 24px;
    stroke-width: 1.5;
}

.app-nav-item.active {
    color: var(--app-primary);
}

.app-nav-item.active svg {
    stroke-width: 2;
}

.app-nav-item-danger.active {
    color: var(--app-danger);
}

.app-nav-item-success.active {
    color: var(--app-success);
}

.app-nav-item:active {
    transform: scale(0.92);
}

/* ==========================================================================
   COMPONENTES DO APP
   ========================================================================== */

/* ---------- Section Title ---------- */
.app-section-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--app-text);
    margin-bottom: var(--space-lg);
    letter-spacing: -0.02em;
}

.app-section-subtitle {
    font-size: 1rem;
    color: var(--app-text-secondary);
    margin-top: calc(var(--space-xs) * -1);
    margin-bottom: var(--space-lg);
}

/* ---------- Hero Banner (Mobile First) ---------- */
.app-hero {
    margin: calc(var(--space-md) * -1);
    margin-bottom: var(--space-lg);
    padding: var(--space-xl) var(--space-lg);
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.app-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 60%);
    pointer-events: none;
}

.app-hero h1 {
    font-size: 1.75rem;
    font-weight: 800;
    margin-bottom: var(--space-sm);
    position: relative;
}

.app-hero p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: var(--space-lg);
    position: relative;
}

/* ---------- Quick Actions (Home) ---------- */
.app-quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-md);
    margin-bottom: var(--space-xl);
}

.app-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-xl) var(--space-md);
    border-radius: var(--app-radius);
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    cursor: pointer;
    min-height: 120px;
}

.app-action-btn-icon {
    font-size: 2.5rem;
}

.app-action-btn:active {
    transform: scale(0.95);
}

.app-action-btn-danger {
    background: linear-gradient(135deg, var(--app-danger-light) 0%, var(--app-danger) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(220, 38, 38, 0.3);
}

.app-action-btn-success {
    background: linear-gradient(135deg, var(--app-success-light) 0%, var(--app-success) 100%);
    color: white;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.3);
}

/* ---------- Stats Banner ---------- */
.app-stats {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--app-radius-sm);
    margin-bottom: var(--space-xl);
    color: #065f46;
    font-weight: 600;
    border: 1px solid #a7f3d0;
}

.app-stats-icon {
    font-size: 1.25rem;
}

.app-stats-number {
    font-size: 1.25rem;
    font-weight: 800;
}

/* ---------- Search & Filters ---------- */
.app-search-bar {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

.app-search-input {
    flex: 1;
    padding: var(--space-md);
    border: 2px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    font-size: 1rem;
    background: var(--app-surface);
    color: var(--app-text);
    transition: all 0.2s ease;
}

.app-search-input:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.app-search-input::placeholder {
    color: var(--app-text-muted);
}

.app-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    background: var(--app-surface);
    border: 2px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    color: var(--app-text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.app-filter-btn:active {
    background: var(--app-border);
}

.app-filter-btn.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: white;
}

/* Filter Pills */
.app-filter-pills {
    display: flex;
    gap: var(--space-sm);
    overflow-x: auto;
    padding-bottom: var(--space-sm);
    margin-bottom: var(--space-lg);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.app-filter-pills::-webkit-scrollbar {
    display: none;
}

.app-filter-pill {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--app-surface);
    border: 1px solid var(--app-border);
    border-radius: 50px;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--app-text-secondary);
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.app-filter-pill:active {
    transform: scale(0.95);
}

.app-filter-pill.active {
    background: var(--app-primary);
    border-color: var(--app-primary);
    color: white;
}

/* ---------- Item Cards ---------- */
.app-items-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.app-item-card {
    display: flex;
    gap: var(--space-md);
    padding: var(--space-md);
    background: var(--app-surface);
    border-radius: var(--app-radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--app-border);
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.app-item-card:active {
    transform: scale(0.98);
    box-shadow: var(--shadow-md);
}

.app-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--app-radius-sm);
    object-fit: cover;
    flex-shrink: 0;
    background: var(--app-bg);
}

.app-item-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
}

.app-item-badge {
    display: inline-flex;
    align-self: flex-start;
    padding: 3px 10px;
    border-radius: 50px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.app-item-badge-perdido {
    background: #fee2e2;
    color: #b91c1c;
}

.app-item-badge-encontrado {
    background: #dcfce7;
    color: #15803d;
}

.app-item-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--app-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-item-meta {
    font-size: 0.85rem;
    color: var(--app-text-secondary);
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* ---------- Empty State ---------- */
.app-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl) var(--space-lg);
    text-align: center;
}

.app-empty-icon {
    font-size: 4rem;
    margin-bottom: var(--space-md);
    opacity: 0.5;
}

.app-empty-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--app-text);
    margin-bottom: var(--space-sm);
}

.app-empty-text {
    color: var(--app-text-secondary);
    margin-bottom: var(--space-lg);
}

/* ---------- Form Styles ---------- */
.app-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.app-form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.app-form-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--app-text);
}

.app-form-input,
.app-form-select,
.app-form-textarea {
    padding: var(--space-md);
    border: 2px solid var(--app-border);
    border-radius: var(--app-radius-sm);
    font-size: 1rem;
    background: var(--app-surface);
    color: var(--app-text);
    transition: all 0.2s ease;
    width: 100%;
}

.app-form-input:focus,
.app-form-select:focus,
.app-form-textarea:focus {
    outline: none;
    border-color: var(--app-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.app-form-textarea {
    min-height: 120px;
    resize: vertical;
}

.app-form-help {
    font-size: 0.85rem;
    color: var(--app-text-muted);
}

.app-form-error {
    font-size: 0.85rem;
    color: var(--app-danger);
    font-weight: 500;
}

.app-form-group.has-error .app-form-input,
.app-form-group.has-error .app-form-select,
.app-form-group.has-error .app-form-textarea {
    border-color: var(--app-danger);
}

/* ---------- Buttons ---------- */
.app-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-xl);
    font-size: 1rem;
    font-weight: 700;
    border-radius: var(--app-radius-sm);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.3s ease;
}

.app-btn:active {
    transform: scale(0.97);
}

.app-btn-primary {
    background: linear-gradient(135deg, var(--app-primary) 0%, var(--app-primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.app-btn-primary:hover {
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.4);
}

.app-btn-secondary {
    background: var(--app-bg);
    color: var(--app-text);
    border: 1px solid var(--app-border);
}

.app-btn-success {
    background: linear-gradient(135deg, var(--app-success-light) 0%, var(--app-success) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(22, 163, 74, 0.3);
}

.app-btn-danger {
    background: linear-gradient(135deg, var(--app-danger-light) 0%, var(--app-danger) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.app-btn-whatsapp {
    background: linear-gradient(135deg, #25d366 0%, #128c7e 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.app-btn-block {
    width: 100%;
}

/* ---------- Item Detail ---------- */
.app-detail {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
}

.app-detail-image {
    width: 100%;
    max-height: 300px;
    object-fit: cover;
    border-radius: var(--app-radius);
    box-shadow: var(--shadow-md);
}

.app-detail-header {
    display: flex;
    gap: var(--space-sm);
    flex-wrap: wrap;
}

.app-detail-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--app-text);
    line-height: 1.3;
}

.app-detail-info {
    background: var(--app-bg);
    border-radius: var(--app-radius-sm);
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.app-detail-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
}

.app-detail-icon {
    font-size: 1.1rem;
    flex-shrink: 0;
}

.app-detail-label {
    font-weight: 600;
    color: var(--app-text);
}

.app-detail-value {
    color: var(--app-text-secondary);
}

.app-detail-contact {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-radius: var(--app-radius);
    padding: var(--space-lg);
    text-align: center;
    border: 1px solid #a7f3d0;
}

.app-detail-contact-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #065f46;
    margin-bottom: var(--space-md);
}

/* ---------- Success Page ---------- */
.app-success {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: var(--space-xl) 0;
}

.app-success-icon {
    font-size: 5rem;
    margin-bottom: var(--space-lg);
    animation: success-bounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes success-bounce {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.app-success-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--app-text);
    margin-bottom: var(--space-sm);
}

.app-success-text {
    color: var(--app-text-secondary);
    margin-bottom: var(--space-xl);
}

.app-success-link-box {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border-radius: var(--app-radius-sm);
    padding: var(--space-lg);
    width: 100%;
    text-align: left;
    margin-bottom: var(--space-xl);
    border: 1px solid #fcd34d;
}

.app-success-link-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #92400e;
    margin-bottom: var(--space-sm);
}

.app-success-link-code {
    background: white;
    padding: var(--space-sm);
    border-radius: var(--app-radius-xs);
    font-size: 0.8rem;
    font-family: 'Monaco', 'Consolas', monospace;
    word-break: break-all;
    color: var(--app-text);
}

/* ---------- Loading State ---------- */
.app-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-2xl);
}

.app-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--app-border);
    border-top-color: var(--app-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   DESKTOP ENHANCEMENTS
   ========================================================================== */

@media (min-width: 768px) {
    body {
        padding-bottom: var(--app-bottom-nav-height);
    }

    .app-main {
        max-width: 640px;
        padding: var(--space-xl);
    }

    /* Grid layout for items on tablet+ */
    .app-items-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-lg);
    }

    .app-item-card {
        flex-direction: column;
        padding: 0;
    }

    .app-item-image {
        width: 100%;
        height: 160px;
        border-radius: var(--app-radius) var(--app-radius) 0 0;
    }

    .app-item-content {
        padding: var(--space-md);
    }

    /* Hero bigger */
    .app-hero h1 {
        font-size: 2.25rem;
    }

    /* Action buttons side by side */
    .app-quick-actions {
        gap: var(--space-lg);
    }

    .app-action-btn {
        min-height: 140px;
    }
}

@media (min-width: 1024px) {
    .app-main {
        max-width: 800px;
    }

    .app-items-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Remove bottom nav on desktop, show sidebar or top nav */
    .app-bottom-nav {
        display: none;
    }

    body {
        padding-bottom: 0;
    }

    /* Show full nav in header on desktop */
    .app-header {
        height: 64px;
    }

    .app-header-inner {
        max-width: 1200px;
    }
}

/* ==========================================================================
   DARK MODE (Auto based on system preference)
   ========================================================================== */

/* ========================================
   Disclaimer / Avisos Legais / Dica
   ======================================== */

/* Banner elegante de aviso na home */
.app-disclaimer-banner {
    display: flex;
    align-items: stretch;
    margin-bottom: var(--space-md, 16px);
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: var(--radius-md, 12px);
    overflow: hidden;
    line-height: 1.5;
}

.app-disclaimer-accent {
    width: 4px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #3b82f6, #0ea5e9);
}

.app-disclaimer-content {
    padding: var(--space-sm, 10px) var(--space-md, 16px);
}

.app-disclaimer-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    color: #0369a1;
}

.app-disclaimer-header strong {
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.app-disclaimer-header svg {
    flex-shrink: 0;
    opacity: 0.8;
}

.app-disclaimer-banner p {
    margin: 0;
    font-size: 0.78rem;
    color: #475569;
}

/* Rodapé de isenção fixo no módulo (base_app) */
.app-module-disclaimer {
    text-align: center;
    padding: var(--space-md, 16px) var(--space-sm, 8px);
    margin-top: var(--space-xl, 32px);
    border-top: 1px solid var(--app-border, #e2e8f0);
    color: var(--app-text-muted, #64748b);
}

.app-module-disclaimer small {
    font-size: 0.75rem;
    letter-spacing: 0.01em;
}

/* Disclaimer no footer de créditos */
.app-footer-disclaimer {
    margin-top: var(--space-xs, 4px);
    font-size: 0.72rem;
    color: var(--app-text-muted, #64748b);
    letter-spacing: 0.01em;
}

/* Bloco de termos no formulário */
.app-terms-box {
    margin-top: var(--space-lg, 24px);
    margin-bottom: var(--space-md, 16px);
    padding: var(--space-md, 16px);
    background: #f8fafc;
    border: 1px solid var(--app-border, #e2e8f0);
    border-radius: var(--radius-md, 12px);
}

.app-terms-box-header {
    display: flex;
    align-items: center;
    gap: var(--space-xs, 4px);
    margin-bottom: var(--space-sm, 8px);
    color: var(--app-text, #1e293b);
    font-size: 0.9rem;
}

.app-terms-box-header svg {
    color: var(--app-primary, #2563eb);
    flex-shrink: 0;
}

.app-terms-box-text {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--app-text-secondary, #64748b);
    margin: 0;
}

/* Dica de segurança no detalhe */
.app-safety-tip {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm, 8px);
    padding: var(--space-sm, 8px) var(--space-md, 16px);
    margin-top: var(--space-lg, 24px);
    background: #fefce8;
    border: 1px solid #fde68a;
    border-radius: var(--radius-md, 12px);
    color: #92400e;
    line-height: 1.4;
}

.app-safety-tip .app-safety-tip-icon {
    flex-shrink: 0;
    margin-top: 1px;
    opacity: 0.8;
}

.app-safety-tip small {
    font-size: 0.8rem;
}

/* Botão submit desabilitado (aguarda aceite termos) */
#btn-submit-item:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: grayscale(0.3);
}

@media (prefers-color-scheme: dark) {
    :root {
        --app-bg: #0f172a;
        --app-surface: #1e293b;
        --app-surface-elevated: #334155;
        --app-border: #334155;
        --app-text: #f1f5f9;
        --app-text-secondary: #94a3b8;
        --app-text-muted: #64748b;
    }

    .app-header {
        background: rgba(30, 41, 59, 0.9);
    }

    .app-bottom-nav {
        background: var(--app-surface);
    }

    .app-form-input,
    .app-form-select,
    .app-form-textarea,
    .app-search-input {
        background: var(--app-bg);
    }

    .app-disclaimer-banner {
        background: #0f1d2e;
        border-color: #1e3a5f;
    }

    .app-disclaimer-accent {
        background: linear-gradient(180deg, #60a5fa, #38bdf8);
    }

    .app-disclaimer-header {
        color: #7dd3fc;
    }

    .app-disclaimer-banner p {
        color: #94a3b8;
    }

    .app-terms-box {
        background: #1e293b;
        border-color: #334155;
    }

    .app-safety-tip {
        background: #1e293b;
        border-color: #4a3728;
        color: #fbbf24;
    }
}

/* ==========================================================================
   PWA INSTALL BANNER
   Banner fixo no topo do app pedindo instalação.
   Aparece via JS se beforeinstallprompt dispara ou como tutorial manual.
   ========================================================================== */
.pwa-install-banner {
    position: sticky;
    top: 0;
    z-index: 100;
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-bottom: 1px solid #bfdbfe;
    padding: 12px 16px;
    animation: pwa-slide-down 0.3s ease;
}

@keyframes pwa-slide-down {
    from { transform: translateY(-100%); opacity: 0; }
    to   { transform: translateY(0); opacity: 1; }
}

.pwa-install-banner-inner {
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-install-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    background: #fff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.pwa-install-text {
    flex: 1;
    min-width: 0;
}

.pwa-install-text strong {
    display: block;
    font-size: 14px;
    color: #1e293b;
    line-height: 1.3;
}

.pwa-install-text span {
    display: block;
    font-size: 12px;
    color: #64748b;
    line-height: 1.3;
}

.pwa-install-btn {
    flex-shrink: 0;
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.pwa-install-btn:hover {
    background: #1d4ed8;
}

.pwa-install-btn:active {
    transform: scale(0.96);
}

.pwa-install-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    padding: 4px;
    margin-left: -4px;
}

.pwa-install-close:hover {
    color: #475569;
}

/* Dark mode do banner */
@media (prefers-color-scheme: dark) {
    .pwa-install-banner {
        background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
        border-bottom-color: #334155;
    }

    .pwa-install-icon {
        background: #334155;
    }

    .pwa-install-icon svg {
        stroke: #60a5fa;
    }

    .pwa-install-text strong {
        color: #f1f5f9;
    }

    .pwa-install-text span {
        color: #94a3b8;
    }

    .pwa-install-close {
        color: #64748b;
    }

    .pwa-install-close:hover {
        color: #94a3b8;
    }
}