:root {
    --primary:      #c1121f;   /* vermelho tomate */
    --primary-dark: #a00f1a;
    --accent:       #f4a261;   /* laranja dourado */
    --bg:           #fffbf7;   /* creme quente */
    --card:         #ffffff;
    --text:         #2c1810;   /* marrom escuro */
    --text-muted:   #9e8070;
    --border:       #ede0d4;
    --radius:       14px;
    --shadow:       0 2px 12px rgba(44,24,16,0.09);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    padding-bottom: 80px;
}

/* HEADER */
.header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.header-inner {
    max-width: 700px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 12px;
}
.header h1 { font-size: 1.3rem; font-weight: 700; flex: 1; }
.header a { color: white; text-decoration: none; }
.btn-icon {
    background: rgba(255,255,255,0.2);
    border: none;
    color: white;
    width: 38px; height: 38px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    font-size: 1.1rem;
    text-decoration: none;
    transition: background 0.2s;
}
.btn-icon:hover { background: rgba(255,255,255,0.3); }

/* BUSCA */
.search-bar {
    max-width: 700px;
    margin: 16px auto;
    padding: 0 16px;
}
.search-bar input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid var(--border);
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    outline: none;
    transition: border 0.2s;
}
.search-bar input:focus { border-color: var(--primary); }

/* FILTROS */
.filtros {
    max-width: 700px;
    margin: 0 auto 16px;
    padding: 0 16px;
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}
.filtros::-webkit-scrollbar { display: none; }
.filtro-btn {
    white-space: nowrap;
    padding: 7px 16px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: white;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.filtro-btn.ativo, .filtro-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.filtro-btn.ativo:first-child,
.filtro-btn:first-child:hover {
    background: var(--primary);
}

/* GRID DE RECEITAS */
.grid {
    max-width: 700px;
    margin: 0 auto;
    padding: 0 16px;
    display: grid;
    gap: 14px;
}

/* CARD */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    display: flex;
    transition: transform 0.15s, box-shadow 0.15s;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.12); }
.card-thumb {
    width: 110px;
    min-height: 100px;
    background: var(--bg);
    flex-shrink: 0;
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    font-size: 2.5rem;
}
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 12px 14px; flex: 1; min-width: 0; }
.card-titulo {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.card-meta { font-size: 0.8rem; color: var(--text-muted); display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.card-fav { margin-left: auto; font-size: 1.2rem; }

/* BADGES */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
}
.badge-texto     { background: #eaf4ff; color: #2980b9; }
.badge-youtube   { background: #fff0f0; color: #e74c3c; }
.badge-instagram { background: #f9f0ff; color: #8e44ad; }
.badge-link      { background: #f0fff4; color: #27ae60; }

/* PÁGINA DE VISUALIZAÇÃO */
.receita-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}
.receita-titulo {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 12px 0 8px;
}
.receita-meta {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 16px;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.receita-conteudo {
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-word;
}
.video-wrapper {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.video-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.link-externo {
    display: flex;
    align-items: center;
    gap: 12px;
    background: white;
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    text-decoration: none;
    color: var(--text);
    font-weight: 600;
    font-size: 1.05rem;
    word-break: break-all;
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 14px; }
.tag {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 4px 12px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* FORMULÁRIO */
.form-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 16px;
}
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    outline: none;
    transition: border 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus { border-color: var(--primary); }
.form-group textarea { resize: vertical; min-height: 180px; }
.tipo-selector {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}
.tipo-option { display: none; }
.tipo-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 16px;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
    background: white;
}
.tipo-label .emoji { font-size: 1.8rem; }
.tipo-option:checked + .tipo-label {
    border-color: var(--primary);
    background: #fff0f1;
    color: var(--primary);
}

/* BOTÕES */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 24px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-danger { background: #e74c3c; color: white; }
.btn-full { width: 100%; justify-content: center; }

/* NAVBAR INFERIOR */
.navbar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background: white;
    border-top: 1px solid var(--border);
    display: flex;
    z-index: 100;
    padding-bottom: env(safe-area-inset-bottom);
}
.navbar a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.7rem;
    gap: 3px;
    transition: color 0.2s;
}
.navbar a.ativo, .navbar a:hover { color: var(--primary); }
.navbar a span:first-child { font-size: 1.4rem; }

/* ESTADOS VAZIOS */
.empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}
.empty .emoji { font-size: 3rem; margin-bottom: 12px; }
.empty p { margin-bottom: 20px; }

/* FAB */
.fab {
    position: fixed;
    bottom: 72px;
    right: 20px;
    width: 56px; height: 56px;
    background: var(--accent);
    color: white;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem;
    box-shadow: 0 4px 16px rgba(244,162,97,0.5);
    text-decoration: none;
    z-index: 99;
    transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover { transform: scale(1.1); box-shadow: 0 6px 20px rgba(244,162,97,0.6); }

/* ÍNDICE A-Z */
.az-barra {
    max-width: 700px;
    margin: 4px auto 16px;
    padding: 0 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.az-letra {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 2px solid #d9cfc8;
    background: white;
    font-size: 0.82rem;
    font-weight: 700;
    text-decoration: none;
    line-height: 1;
    transition: all 0.15s;
    box-sizing: border-box;
}
.az-com-receita {
    color: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 1px 4px rgba(193,18,31,0.15);
}
.az-com-receita:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-1px);
}
.az-ativa {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(193,18,31,0.35);
    transform: scale(1.1);
}
.az-vazia {
    color: #b8a99a;
    border-color: #d9cfc8;
    background: transparent;
    cursor: default;
}
.az-limpar {
    margin-left: 6px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border: 1px solid var(--border);
    border-radius: 50px;
    background: white;
    white-space: nowrap;
    height: 30px;
    display: flex;
    align-items: center;
}
.az-limpar:hover { color: var(--primary); border-color: var(--primary); }

/* CABEÇALHO DE GRUPO */
.az-grupo-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 0 2px;
}
.az-grupo-letra {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--primary);
    min-width: 28px;
    line-height: 1;
}
.az-grupo-linha {
    flex: 1;
    height: 2px;
    background: linear-gradient(to right, var(--primary), transparent);
    border-radius: 2px;
    opacity: 0.25;
}
.az-grupo-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 50px;
    padding: 1px 8px;
    font-weight: 600;
}

/* SVG ICONS */
.icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    vertical-align: middle;
    flex-shrink: 0;
}
.icon-sm { width: 14px; height: 14px; }
.icon-md { width: 22px; height: 22px; }
.icon-lg { width: 28px; height: 28px; }

.navbar a svg.icon {
    width: 22px;
    height: 22px;
    display: block;
}

/* UTILS */
.mt-16 { margin-top: 16px; }
.flex-gap { display: flex; gap: 10px; }
.secao-titulo {
    max-width: 700px;
    margin: 20px auto 10px;
    padding: 0 16px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

@media (min-width: 500px) {
    .tipo-selector { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 500px) {
    .receita-conteudo {
        margin: 0 -16px;
        border-radius: 0;
    }

    /* Botões de ação da receita: dividem o espaço igualmente */
    .receita-page .flex-gap .btn {
        flex: 1;
        justify-content: center;
        padding: 12px 10px;
        font-size: 0.9rem;
    }
}

/* Evita scroll horizontal causado por overflow dos botões */
body { overflow-x: hidden; }

/* BOTÃO WHATSAPP */
.btn-whatsapp {
    background: #25D366;
    color: white;
}
.btn-whatsapp:hover { background: #1ebe5a; }

/* NOTAS PESSOAIS */
.notas-section {
    background: #fffef5;
    border: 1.5px solid #ede0a0;
    border-radius: var(--radius);
    padding: 16px;
    margin-top: 20px;
}
.notas-header {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 10px;
}
.notas-section textarea {
    width: 100%;
    min-height: 90px;
    padding: 10px 12px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    resize: vertical;
    background: white;
    outline: none;
    transition: border 0.2s;
    line-height: 1.6;
}
.notas-section textarea:focus { border-color: #c9a800; }
.notas-rodape {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
}
.btn-nota {
    background: #f4a261;
    color: white;
    padding: 8px 18px;
    font-size: 0.9rem;
    border: none;
    border-radius: 50px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
    display: inline-flex;
    align-items: center;
}
.btn-nota:hover { background: #e08040; }
.nota-status {
    font-size: 0.82rem;
    color: var(--text-muted);
    transition: opacity 0.3s;
}
.nota-status.ok { color: #27ae60; }

/* CARD INSTAGRAM */
.ig-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: linear-gradient(135deg, #833ab4, #fd1d1d, #fcb045);
    border-radius: var(--radius);
    padding: 20px;
    text-decoration: none;
    color: white;
    transition: opacity 0.2s;
}
.ig-card:hover { opacity: 0.9; }
.ig-card-logo { flex-shrink: 0; }
.ig-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1;
}
.ig-card-label {
    font-size: 1rem;
    font-weight: 700;
}
.ig-card-url {
    font-size: 0.75rem;
    opacity: 0.8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* TOGGLE DE BUSCA (título / ingrediente) */
.search-toggle {
    max-width: 700px;
    margin: -8px auto 12px;
    padding: 0 16px;
    display: flex;
    gap: 6px;
}
.toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    border-radius: 50px;
    border: 2px solid var(--border);
    background: white;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}
.toggle-btn.ativo {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
}
.toggle-btn:hover:not(.ativo) {
    border-color: var(--primary);
    color: var(--primary);
}

/* INPUT DE INGREDIENTE */
.ingrediente-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.ingrediente-input-wrap input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    border: 2px solid #f4a261;
    border-radius: 50px;
    font-size: 1rem;
    background: white;
    outline: none;
    transition: border 0.2s;
}
.ingrediente-input-wrap input:focus { border-color: #e08040; }
.ingrediente-limpar {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    text-decoration: none;
}
.ingrediente-limpar:hover { color: var(--primary); }
