@import 'global.css';

/* Página de doação. Cores, botões e campos vêm de theme.css. */
body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.card {
    width: 100%;
    max-width: 420px;
    padding: 32px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo { width: 72px; height: auto; }
.label { color: var(--muted); font-size: 14px; font-weight: 600; letter-spacing: -0.224px; align-self: flex-start; margin-top: 4px; }

input { width: 100%; outline: none; -webkit-appearance: none; appearance: none; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; }
input[type="number"] { -moz-appearance: textfield; }

button { width: 100%; cursor: pointer; border: none; outline: none; -webkit-tap-highlight-color: transparent; }

/* Carteiras: configurator-option-chip (selecionada = 2px azul) */
.wallet-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.wallet-buttons button {
    background: var(--surface); color: var(--text);
    border: 1px solid var(--line) !important; border-radius: 9999px;
    padding: 12px 16px; min-height: 44px; font-size: 14px; font-weight: 400; letter-spacing: -0.224px;
    transition: transform .12s ease, border-color .15s ease;
}
.wallet-buttons button:hover { border-color: var(--muted) !important; }
.wallet-buttons button.selected { border: 2px solid var(--primary-focus) !important; padding: 11px 15px; font-weight: 600; background: var(--surface); }

.toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(120px);
    padding: 14px 22px; font-size: 14px; letter-spacing: -0.224px; font-weight: 400;
    text-align: center; max-width: 90vw; z-index: 999;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1);
    pointer-events: none;
}
.toast.show { transform: translateX(-50%) translateY(0); }

.waiting-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.35);
    -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; padding: 20px;
}
.waiting-overlay[hidden] { display: none !important; }
.waiting-box {
    background: rgba(255,255,255,0.10); border: 1px solid rgba(255,255,255,0.18); border-radius: 24px;
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    padding: 32px 24px; max-width: 340px; width: 100%;
    display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center;
}
:root[data-theme="light"] .waiting-overlay { background: rgba(255,255,255,0.35); }
:root[data-theme="light"] .waiting-box { background: rgba(255,255,255,0.55); border-color: rgba(255,255,255,0.7); }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: girar 0.9s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }
.waiting-box p { color: var(--text); font-size: 17px; line-height: 1.47; margin: 0; }
.waiting-box .btn-sec { min-height: 44px; }

/* Mensagem de voz */
.audio-recorder { width: 100%; }
.audio-rec-row { width: 100%; display: flex; align-items: center; gap: 10px; background: var(--surface-2); border-radius: 18px; padding: 10px 14px; }
.audio-rec-btn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; font-size: 14px; border-radius: 9999px; min-height: 44px; letter-spacing: -0.224px; }
.audio-rec-btn-start { background: var(--surface); color: var(--primary-link); border: 1px solid var(--line) !important; }
.audio-rec-btn-start:hover { background: var(--tint-primary); }
.audio-rec-btn-stop { background: var(--tint-danger); color: var(--danger); border: 0 !important; width: auto; padding: 8px 16px; margin-left: auto; }
.audio-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); animation: audioRecPulse 1s ease-in-out infinite; flex-shrink: 0; }
@keyframes audioRecPulse { 0%, 100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.4; transform: scale(0.8); } }
.audio-rec-timer { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; }
.audio-rec-play-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; border: 0 !important; display: flex; align-items: center; justify-content: center; padding: 0; }
.audio-rec-play-btn.playing i:before { content: "\\f04c"; } /* fa-pause */
.audio-rec-preview-label { flex: 1; color: var(--text-2); font-size: 14px; text-align: left; letter-spacing: -0.224px; }
.audio-rec-discard-btn { flex-shrink: 0; width: 44px; height: 44px; border-radius: 50%; background: var(--surface); color: var(--muted); border: 0 !important; padding: 0; font-size: 14px; }
.audio-rec-discard-btn:hover { background: var(--tint-danger); color: var(--danger); }
.audio-rec-unsupported { width: 100%; color: var(--muted); font-size: 12px; text-align: center; line-height: 1.5; padding: 6px 4px; }

/* Cabeçalho: logo → foto + nome do streamer */
.donate-header { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.donate-header .logo[hidden], .hd-avatar[hidden], .hd-sub[hidden], .hd-avatar img[hidden], .hd-initial[hidden] { display: none; }
.hd-avatar { position: relative; width: 104px; height: 104px; border-radius: 50%; overflow: hidden; background: var(--surface-2); border: 2px solid var(--line); animation: hd-in 0.3s ease; }
.donate-header[data-state="found"] .hd-avatar { border-color: var(--primary-focus); }
.hd-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hd-initial { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; color: var(--text); font-size: 44px; font-weight: 600; }
.donate-header[data-state="loading"] .hd-avatar::after { content: ''; position: absolute; top: 50%; left: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--primary); animation: hd-spin 0.9s linear infinite; }
@keyframes hd-in { from { opacity: 0; transform: scale(0.92); } to { opacity: 1; transform: none; } }
@keyframes hd-spin { to { transform: rotate(360deg); } }
.donate-header h1 { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donate-header[data-state="found"] h1 { font-size: 28px; }
.donate-header[data-state="notfound"] h1 { font-size: 21px; color: var(--amber); }
.hd-sub { color: var(--muted); font-size: 14px; line-height: 1.35; }
.donate-header[data-state="found"] .hd-sub { color: var(--text-2); }

@media (max-width: 480px) {
    body { padding: 14px; }
    .card { padding: 26px 16px; }
}

/* Contactos do streamer (e-Mola / M-Pesa) e mensagem de confirmação */
.pay-contacts { width: 100%; }
.pay-row { display: flex; align-items: center; gap: 12px; box-sizing: border-box; min-height: 64px; padding: 8px 8px 8px 12px; margin-bottom: 8px; border-radius: 24px; background: var(--surface-2); }
.pc-ico { width: 44px; height: 44px; border-radius: 12px; flex: none; object-fit: cover; }
.pc-who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.pc-who b { font-size: 15px; color: var(--text); }
.pc-who small { font-size: 13px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-num { font-variant-numeric: tabular-nums; font-size: 16px; font-weight: 600; letter-spacing: .02em; color: var(--text); }
.pay-row .pc-copy { width: 38px; min-height: 38px; height: 38px; padding: 0; display: grid; place-items: center; border-radius: 50%; border: 1px solid var(--line) !important; background: transparent !important; color: var(--text-2) !important; flex: none; }
.pc-copy svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pc-copy.ok { color: var(--green) !important; border-color: var(--green) !important; }
#confirm-msg { width: 100%; box-sizing: border-box; min-height: 104px; padding: 14px 18px; border-radius: 22px; border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; resize: vertical; outline: none; }
.confirm-chip { width: 100%; box-sizing: border-box; padding: 9px 16px; border-radius: 9999px; font-size: 13px; text-align: center; background: var(--surface-2); color: var(--text-2); word-break: break-all; }
.confirm-chip.ok { background: var(--tint-green); color: var(--green); font-weight: 600; }
.confirm-chip.bad { background: var(--tint-amber); color: var(--amber); }

/* Botão Colar + campo de mensagem */
.label-row { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.label-row .label { margin: 4px 0 0; }
.btn-colar { width: auto; flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 14px; border-radius: 9999px; font-size: 13px; font-weight: 600; background: var(--primary); color: var(--on-primary, #fff); letter-spacing: -0.224px; transition: transform .12s ease, background .15s ease; }
.btn-colar:active { transform: scale(0.96); }
.btn-colar.ok { background: var(--green); }
#message { width: 100%; box-sizing: border-box; min-height: 84px; padding: 14px 18px; border-radius: 22px; border: 0; background: var(--surface-2); color: var(--text); font: inherit; font-size: 15px; resize: vertical; outline: none; }
.msg-hint { margin-top: 4px; font-size: 12px; line-height: 1.4; color: var(--muted); }
.msg-hint[hidden] { display: none; }
.msg-count { align-self: flex-end; margin-top: -6px; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Campo de colar a confirmação: compacto */
#confirm-msg { min-height: 56px !important; height: 56px; padding: 10px 16px; border-radius: 18px; font-size: 14px; resize: none; overflow: hidden; }
#confirm-msg:focus { height: 96px; overflow: auto; }
