/* ═══════════════════════════════════════════════
   avaliacao-form.css
   Estilos do formulário e lista de avaliações
═══════════════════════════════════════════════ */

/* ── Formulário ── */
#avaliacao-wrap {
    max-width: 560px;
    margin: 2rem auto;
    font-family: inherit;
}

#avaliacao-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.av-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.av-label {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #6b7280;
}

/* ── Estrelas ── */
.av-stars {
    display: flex;
    gap: 0.25rem;
}

.av-star {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 2rem;
    color: #d1d5db;
    padding: 0;
    line-height: 1;
    transition: color 0.15s, transform 0.12s;
}

.av-star:hover,
.av-star.active {
    color: #f59e0b;
    transform: scale(1.15);
}

.av-star:focus-visible {
    outline: 2px solid #f59e0b;
    border-radius: 4px;
}

/* ── Textarea ── */
#avaliacao_texto {
    width: 100%;
    box-sizing: border-box;
    padding: 0.75rem 0.875rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9375rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.15s, box-shadow 0.15s;
}

#avaliacao_texto:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ── Contador de caracteres ── */
.av-char {
    font-size: 0.75rem;
    color: #9ca3af;
    text-align: right;
}

.av-char.near-limit {
    color: #ef4444;
}

/* ── Mensagens de erro por campo ── */
.av-error {
    font-size: 0.8rem;
    color: #ef4444;
    min-height: 1em;
}

.has-error #avaliacao_texto,
.has-error .av-stars {
    border-color: #ef4444;
}

/* ── Botão enviar ── */
#av-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.8125rem;
    background: #f59e0b;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, opacity 0.15s;
}

#av-submit:hover:not(:disabled) {
    background: #d97706;
    transform: translateY(-1px);
}

#av-submit:active:not(:disabled) {
    transform: none;
}

#av-submit:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ── Spinner dentro do botão ── */
.av-btn-spinner {
    display: none;
    width: 1em;
    height: 1em;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: av-spin 0.6s linear infinite;
}

#av-submit.loading .av-btn-label  { opacity: 0.7; }
#av-submit.loading .av-btn-spinner { display: block; }

@keyframes av-spin {
    to { transform: rotate(360deg); }
}

/* ── Feedback global ── */
#av-feedback {
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
}

#av-feedback:not(:empty) {
    padding: 0.75rem 1rem;
}

.av-feedback-success {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
}

.av-feedback-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
}

/* ── Mensagem de login ── */
.avaliacao-msg {
    font-size: 0.9rem;
    color: #6b7280;
}

/* ══════════════════════════════════════════════
   Lista de avaliações [avaliacao_lista]
══════════════════════════════════════════════ */

.avaliacao-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 560px;
    margin: 2rem auto;
}

/* ── Resumo com média ── */
.avaliacao-resumo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
}

.resumo-media {
    font-size: 2rem;
    font-weight: 700;
    color: #92400e;
    line-height: 1;
}

.resumo-estrelas {
    font-size: 1.25rem;
    color: #f59e0b;
    letter-spacing: 2px;
}

.resumo-total {
    font-size: 0.875rem;
    color: #6b7280;
}

/* ── Cards individuais ── */
.avaliacao-card {
    padding: 1.125rem 1.25rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.avaliacao-card-header {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.avaliacao-autor {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #111827;
}

.avaliacao-estrelas {
    font-size: 1rem;
    color: #f59e0b;
    letter-spacing: 1px;
}

.star-vazia {
    color: #d1d5db;
}

.avaliacao-data {
    font-size: 0.8rem;
    color: #9ca3af;
    margin-left: auto;
}

.avaliacao-texto {
    margin: 0;
    font-size: 0.9375rem;
    color: #374151;
    line-height: 1.6;
}

/* ── Sem avaliações ── */
.avaliacao-vazio {
    font-size: 0.9rem;
    color: #9ca3af;
    text-align: center;
    padding: 2rem;
}

/* ── Responsivo ── */
@media (max-width: 480px) {
    #avaliacao-form { padding: 0 0.25rem; }
    .av-star        { font-size: 1.75rem; }
    .avaliacao-data { margin-left: 0; width: 100%; }
}