/* =====================================================================
   AprovAKI — aki_capa_editor.css  (Bloco 8 · recompensa Prata)
   Estilos do botão de editar capa e do modal do editor.
   Mobile-first (360 px validado).

   HOTFIX capa-btn v2 (25/07/2026):
   Diego avaliou o chip anterior como grande demais e chamativo demais
   sobre a capa. Reduzimos altura, padding, tipografia e alfa do fundo
   para ficar discreto e elegante, mantendo lilás oficial (#4B3CB8) e
   coerência com a paleta lilás/cinza/branco (D1). Nada mudou no modal
   do editor, só no chip flutuante da capa e no cadeado "Editar na Prata".
   ===================================================================== */

/* Wrapper acima da .perfil-banner que segura o botão flutuante e o cadeado */
.aki-capa-wrap {
    position: relative;
    width: 100%;
    box-sizing: border-box;
    --aki-capa-safe-x: 12px;
    --aki-capa-safe-y: 10px;
}

/* Precisa ser mais específico que o tooltip global:
   aki_ui_extra.css define [data-aki-tooltip] { position: relative; }
   e quebrava o posicionamento absoluto do cadeado da capa. */
.aki-capa-wrap > .aki-capa-btn,
.aki-capa-wrap > .aki-capa-lock {
    position: absolute;
    left: auto;
    right: var(--aki-capa-safe-x);
    bottom: var(--aki-capa-safe-y);
    top: auto;
}

/* Botão de editar capa (Prata+) — canto inferior direito da capa.
   Discreto: pill baixinho, texto pequeno, fundo bem translúcido. */
.aki-capa-btn {
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 10px;
    max-width: calc(100% - (var(--aki-capa-safe-x) * 2));
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.55);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.55);
    color: #4B3CB8;
    font: 600 0.72rem/1 'Inter', system-ui, sans-serif;
    letter-spacing: 0.01em;
    cursor: pointer;
    backdrop-filter: blur(8px) saturate(130%);
    -webkit-backdrop-filter: blur(8px) saturate(130%);
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.05),
        0 3px 10px rgba(75, 60, 184, 0.10);
    transition: background .18s ease, box-shadow .18s ease, transform .12s ease, opacity .18s ease;
    opacity: 0.92;
}
.aki-capa-btn:hover {
    background: rgba(255, 255, 255, 0.78);
    opacity: 1;
    box-shadow:
        0 1px 2px rgba(15, 23, 42, 0.07),
        0 6px 14px rgba(75, 60, 184, 0.16);
}
.aki-capa-btn:active { transform: translateY(1px); }
.aki-capa-btn:focus-visible {
    outline: 2px solid #7E5BEF;
    outline-offset: 2px;
}
.aki-capa-btn i {
    font-size: 0.82rem;
    line-height: 1;
    color: #7E5BEF;
}

/* Cadeado quando ainda não é Prata — mesma linguagem visual, ainda
   mais discreto que o botão liberado (menor alfa, tipografia menor). */
.aki-capa-lock {
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 24px;
    padding: 0 9px;
    max-width: calc(100% - (var(--aki-capa-safe-x) * 2));
    box-sizing: border-box;
    border: 1px solid rgba(255, 255, 255, 0.45);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.42);
    color: #4B3CB8;
    font: 500 0.68rem/1 'Inter', system-ui, sans-serif;
    cursor: help;
    user-select: none;
    backdrop-filter: blur(8px) saturate(125%);
    -webkit-backdrop-filter: blur(8px) saturate(125%);
    box-shadow: 0 2px 8px rgba(75, 60, 184, 0.08);
    opacity: 0.88;
    transition: opacity .18s ease, background .18s ease;
}
.aki-capa-lock:hover,
.aki-capa-lock:focus-visible {
    opacity: 1;
    background: rgba(255, 255, 255, 0.66);
}
.aki-capa-lock i {
    font-size: 0.78rem;
    color: #7E5BEF;
}
.aki-capa-btn span,
.aki-capa-lock span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Tooltip do cadeado: mantém o balão dentro da viewport no mobile. */
.aki-capa-lock[data-aki-tooltip]::after {
    left: auto;
    right: 0;
    width: max-content;
    max-width: min(280px, calc(100vw - 32px));
    background: #ffffff;
    color: #514c74;
    border: 1px solid rgba(75, 60, 184, 0.14);
    border-radius: 12px;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
    line-height: 1.35;
    box-shadow:
        0 4px 8px rgba(20, 12, 60, 0.08),
        0 12px 28px rgba(20, 12, 60, 0.14);
    transform: translateY(4px);
}
.aki-capa-lock[data-aki-tooltip]::before {
    left: auto;
    right: 18px;
    border-top-color: #ffffff;
    filter: drop-shadow(0 2px 2px rgba(20, 12, 60, 0.08));
    transform: translateY(4px);
}
.aki-capa-lock[data-aki-tooltip]:hover::after,
.aki-capa-lock[data-aki-tooltip]:focus-visible::after {
    transform: translateY(0);
}
.aki-capa-lock[data-aki-tooltip]:hover::before,
.aki-capa-lock[data-aki-tooltip]:focus-visible::before {
    transform: translateY(0);
}

@media (max-width: 480px) {
    .aki-capa-wrap {
        --aki-capa-safe-x: 10px;
        --aki-capa-safe-y: 10px;
    }
    .aki-capa-btn  { height: 26px; padding: 0 9px;  font-size: 0.68rem; gap: 4px; }
    .aki-capa-btn i { font-size: 0.78rem; }
    .aki-capa-lock { height: 22px; padding: 0 8px;  font-size: 0.64rem; gap: 4px; }
    .aki-capa-lock i { font-size: 0.72rem; }
    .aki-capa-lock[data-aki-tooltip]::after {
        max-width: min(260px, calc(100vw - 24px));
    }
}

/* ====== MODAL DO EDITOR (inalterado — só o chip flutuante mudou) ====== */

.aki-capa-modal {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 16px;
}
.aki-capa-modal.is-open { display: flex; }

.aki-capa-modal__card {
    background: #fff;
    width: 100%;
    max-width: 520px;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.24);
    max-height: 92vh;
    overflow-y: auto;
}

.aki-capa-modal__title {
    margin: 0 0 4px;
    font: 700 1.15rem/1.2 'Inter', system-ui, sans-serif;
    color: #1E1E2E;
}
.aki-capa-modal__hint {
    margin: 0 0 14px;
    font: 400 0.85rem/1.35 'Inter', system-ui, sans-serif;
    color: #5A5A72;
}

/* Preview 3:1 (mesmo aspecto da .perfil-banner atual) */
.aki-capa-preview {
    width: 100%;
    aspect-ratio: 3 / 1;
    border-radius: 14px;
    background: #EDE7FE center center / cover no-repeat;
    position: relative;
    overflow: hidden;
    cursor: grab;
    user-select: none;
    touch-action: none;
    border: 1px solid #E1E1EA;
}
.aki-capa-preview.is-dragging { cursor: grabbing; }
.aki-capa-preview__placeholder {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: #7E5BEF;
    font: 600 0.9rem/1.2 'Inter', sans-serif;
    text-align: center;
    padding: 12px;
}

.aki-capa-actions-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    flex-wrap: wrap;
}

.aki-capa-file-label {
    flex: 1 1 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px;
    background: #EDE7FE;
    color: #4B3CB8;
    font: 600 0.9rem/1 'Inter', sans-serif;
    border-radius: 12px;
    cursor: pointer;
    border: 1px dashed #7E5BEF;
    transition: background .18s ease;
}
.aki-capa-file-label:hover { background: #ddd6fe; }
.aki-capa-file-label input[type="file"] { display: none; }

.aki-capa-slider-wrap {
    margin-top: 14px;
}
.aki-capa-slider-wrap label {
    display: block;
    font: 500 0.8rem/1.2 'Inter', sans-serif;
    color: #5A5A72;
    margin-bottom: 6px;
}
.aki-capa-slider {
    width: 100%;
    accent-color: #7E5BEF;
}

.aki-capa-buttons {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    justify-content: flex-end;
    flex-wrap: wrap;
}
.aki-capa-buttons button {
    height: 44px;
    padding: 0 18px;
    border-radius: 12px;
    font: 600 0.92rem/1 'Inter', sans-serif;
    cursor: pointer;
    border: none;
}
.aki-capa-buttons .aki-btn-cancel {
    background: #F4F4F7;
    color: #1E1E2E;
    border: 1px solid #E1E1EA;
}
.aki-capa-buttons .aki-btn-save {
    background: #7E5BEF;
    color: #fff;
    box-shadow: 0 2px 6px rgba(126, 91, 239, 0.25);
}
.aki-capa-buttons .aki-btn-save:disabled {
    opacity: .55;
    cursor: not-allowed;
    box-shadow: none;
}
.aki-capa-buttons .aki-btn-save:hover:not(:disabled) { filter: brightness(1.05); }

.aki-capa-msg {
    margin-top: 10px;
    font: 500 0.82rem/1.3 'Inter', sans-serif;
    min-height: 1.1em;
}
.aki-capa-msg.is-err  { color: #E5484D; }
.aki-capa-msg.is-ok   { color: #3DBE8B; }

@media (prefers-reduced-motion: reduce) {
    .aki-capa-btn, .aki-capa-lock, .aki-capa-buttons button { transition: none; }
}
