/* ══════════════════════════════════════
   anunciar.css
══════════════════════════════════════ */

/* ── Card oculto antes da categoria ser escolhida ── */
.form-card-hidden {
    display: none !important;
}

/* ── Grade de categorias ── */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
    margin-top: .5rem;
}

.cat-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 7px;
    padding: 1rem .5rem;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: var(--radius);
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
    font-size: .82rem;
    cursor: pointer;
    transition: all .2s;
    text-align: center;
}

.cat-btn> :first-child {
    font-size: 1.6rem;
    line-height: 1;
}

.cat-btn:hover {
    border-color: var(--accent);
    background: rgba(255, 85, 51, .07);
    color: var(--text);
}

.cat-btn.active {
    border-color: var(--accent);
    background: rgba(255, 85, 51, .15);
    color: var(--accent);
    font-weight: 600;
}

/* ── Drag-over ── */
.upload-area.drag-over {
    border-color: var(--accent);
    background: rgba(255, 85, 51, .06);
}

/* ── Checkboxes ── */
.checkboxes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
    gap: 8px;
    margin-top: 6px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    color: var(--muted);
    cursor: pointer;
    padding: 6px 10px;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: all .15s;
}

.checkbox-item:hover {
    border-color: var(--border2);
    color: var(--text);
}

.checkbox-item input[type="checkbox"] {
    accent-color: var(--accent);
    width: 15px;
    height: 15px;
    cursor: pointer;
}

.checkbox-item:has(input:checked) {
    border-color: var(--accent);
    background: rgba(255, 85, 51, .08);
    color: var(--text);
}

.anunciar-main {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.anunciar-titulo {
    margin-bottom: 2rem;
}

.anunciar-titulo h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.02em;
    margin-bottom: .4rem;
}

.anunciar-titulo p {
    color: var(--muted);
    font-size: .95rem;
}

/* ── Cards do formulário ── */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.75rem 1.5rem;
    margin-bottom: 1.25rem;
}

.form-card h2 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text);
}

.form-card h2 .opcional {
    font-size: .8rem;
    font-weight: 400;
    color: var(--muted);
    font-family: 'DM Sans', sans-serif;
}

/* ── Fields ── */
.field {
    margin-bottom: 1rem;
    position: relative;
}

.field label {
    display: block;
    font-size: .82rem;
    font-weight: 500;
    color: var(--muted);
    margin-bottom: 6px;
}

.field input,
.field textarea,
.field select {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border2);
    border-radius: 10px;
    padding: 11px 14px;
    color: var(--text);
    font-family: 'DM Sans', sans-serif;
    font-size: .95rem;
    outline: none;
    transition: border-color .2s;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
    border-color: var(--accent);
}

.field input::placeholder,
.field textarea::placeholder {
    color: var(--muted);
}

.field select {
    cursor: pointer;
}

.field select option {
    background: var(--bg2);
    color: var(--text);
}

.field textarea {
    resize: vertical;
    min-height: 110px;
}

.contador {
    position: absolute;
    right: 0;
    bottom: -18px;
    font-size: .72rem;
    color: var(--muted);
}

/* ── Grids ── */
.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

/* ── Upload ── */
.upload-area {
    border: 2px dashed var(--border2);
    border-radius: var(--radius);
    padding: 1.5rem;
    cursor: pointer;
    transition: border-color .2s, background .2s;
    position: relative;
}

.upload-area:hover,
.upload-area:focus {
    border-color: var(--accent);
    background: rgba(255, 85, 51, .04);
    outline: none;
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    text-align: center;
    padding: 1rem 0;
}

.upload-icon {
    font-size: 2rem;
}

.upload-placeholder p {
    font-size: .9rem;
}

.upload-placeholder small {
    font-size: .78rem;
    color: var(--muted);
}

.upload-dica {
    font-size: .78rem;
    color: var(--muted);
    margin-top: 8px;
}

/* ── Preview de fotos ── */
.preview-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.preview-item {
    position: relative;
    width: 110px;
    height: 110px;
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--border2);
}

.preview-item .remover-foto {
    position: absolute;
    top: 4px;
    right: 4px;
    background: rgba(0, 0, 0, .7);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: .75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.preview-item .remover-foto:hover {
    background: var(--accent);
}

.preview-item.capa::after {
    content: 'Capa';
    position: absolute;
    bottom: 4px;
    left: 4px;
    background: var(--accent);
    color: #fff;
    font-size: .65rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* ── Preview de vídeo ── */
#previewVideo video {
    width: 100%;
    max-width: 400px;
    border-radius: 10px;
    border: 1px solid var(--border2);
    margin-top: 12px;
}

/* ── Botão publicar ── */
.form-actions {
    margin-top: 1.5rem;
}

.btn-publicar {
    width: 100%;
    padding: 16px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-family: 'Syne', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, transform .15s;
}

.btn-publicar:hover {
    background: var(--accent2);
}

.btn-publicar:active {
    transform: scale(.98);
}

.btn-publicar:disabled {
    background: var(--surface2);
    color: var(--muted);
    cursor: not-allowed;
}

.msg-publicar {
    text-align: center;
    margin-bottom: 1rem;
    font-size: .9rem;
    min-height: 20px;
    border-radius: 8px;
    padding: 0;
}

.msg-publicar.sucesso {
    color: #4ade80;
    background: rgba(74, 222, 128, .1);
    padding: 10px;
}

.msg-publicar.erro {
    color: #f87171;
    background: rgba(248, 113, 113, .1);
    padding: 10px;
}

@media (max-width: 600px) {
    .grid-3 {
        grid-template-columns: 1fr;
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }

    .anunciar-main {
        padding: 1.5rem 1rem 3rem;
    }
}