/* ========================================================
   BASE ABSOLUTA (Fundo Metálico Profundo)
======================================================== */
html, body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    background-color: #1e222a; 
    background-image: linear-gradient(to bottom, #1e222a, #0d1015);
    background-attachment: fixed;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #EEEEEE;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: max(10px, env(safe-area-inset-top)) 0 15px 0; 
    box-sizing: border-box;
}

/* ========================================================
   CONTEÚDO PRINCIPAL (Compacto e Altamente Agrupado)
======================================================== */
.main-content {
    width: 92%; 
    max-width: 380px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px; 
}

.header { 
    text-align: center; 
    width: 100%; 
    margin-bottom: 0; 
}

.guild-logo.large { 
    height: 70px; 
    width: auto;
    display: block;
    margin: 0 auto 2px auto;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5)); 
}

h1 { 
    font-size: 1.15rem; 
    font-weight: 800; 
    margin: 0; 
    color: #e2e8f0; 
    letter-spacing: 0.5px; 
}

.subtitle { 
    font-size: 0.75rem; 
    color: #9ca3af; 
    margin: 0; 
    font-weight: 500;
}

/* --- Cartões Tema Platina/Prata Claro (Mais finos) --- */
.card {
    background: linear-gradient(to bottom, #ffffff, #f0f2f5);
    width: 100%;
    border-radius: 14px; 
    padding: 14px 15px; 
    box-sizing: border-box;
    position: relative;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
    border: 1px solid #d1d5db;
}

/* Títulos Padronizados */
.card-title { color: #b45309; margin: 0 0 4px 0; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; font-weight: 800; }
.card-desc { color: #6b7280; font-size: 0.8rem; margin-bottom: 12px; font-weight: 600; line-height: 1.3;}
.card-link { color: #b45309; cursor: pointer; font-weight: bold; text-decoration: underline; }

/* --- Controle Segmentado Interno --- */
.segmented-control {
    display: flex;
    background-color: #e2e6eb;
    border-radius: 8px;
    padding: 3px; 
    margin-bottom: 12px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
}

.segment-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: #6b7280;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    padding: 6px 0; 
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.25s ease;
}

.segment-btn.active {
    background-color: #ffffff;
    color: #b45309;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

/* --- Entradas (Inputs Universais e Compactos) --- */
.input-row { 
    margin-bottom: 10px; 
    display: flex; 
    flex-direction: column; 
    gap: 4px; 
    position: relative; 
}
.input-row:last-child { margin-bottom: 0; }

label { font-size: 0.8rem; color: #374151; font-weight: 700; margin: 0; }

input[type="number"], input[type="text"], input[type="password"], input[type="email"], input[type="tel"] { 
    background-color: #e2e6eb; 
    border: 1px solid #cbd0d8; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05);
    color: #1e222a; 
    font-size: 0.9rem; 
    font-weight: 700; 
    border-radius: 8px; 
    outline: none; 
    transition: all 0.2s; 
    box-sizing: border-box;
    padding: 10px 12px; 
    width: 100%; 
}

.card-inputs input { padding-right: 32px; }

input:focus { 
    border-color: #eab308; 
    background-color: #ffffff; 
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.05), 0 0 0 2px rgba(234, 179, 8, 0.2);
}

input:disabled { opacity: 0.6; cursor: not-allowed; }

.input-icon { position: absolute; bottom: 10px; right: 12px; font-size: 0.95rem; color: #9ca3af; }

/* --- Cartão de Desconto e Linha do Slider Perfeita --- */
.discount-header { display: flex; justify-content: space-between; margin-bottom: 4px;}
.gold-text { color: #b45309; font-weight: 800; font-size: 0.8rem;} 
.silver-text { color: #4b5563; font-weight: 800; font-size: 0.8rem;}

.slider-box {
    padding: 10px 4px;
    display: flex;
    align-items: center;
}

.discount-slider { 
    -webkit-appearance: none !important; 
    appearance: none !important;
    width: 100% !important; 
    height: 4px !important; 
    background-color: #cbd0d8 !important; 
    border-radius: 2px !important; 
    outline: none !important; 
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.1) !important;
    border: none !important; 
    padding: 0 !important; 
}

.discount-slider::-webkit-slider-thumb { 
    -webkit-appearance: none; 
    appearance: none; 
    width: 20px; 
    height: 20px; 
    border-radius: 50%; 
    background: linear-gradient(to bottom, #fde047, #ca8a04);
    border: 1px solid #a16207;
    cursor: pointer; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.3); 
}

.discount-info { display: flex; align-items: center; gap: 6px; color: #6b7280; font-size: 0.7rem; font-weight: 600; margin-top: 2px;}
.ticket-icon { color: #b45309; }

/* --- Resultado (Total) --- */
.card-result { 
    background: linear-gradient(to bottom, #1f232b, #11141a);
    border: 1px solid #374151;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.4);
    padding: 12px 14px; 
    width: 100%;
    border-radius: 12px;
    box-sizing: border-box;
    position: relative;
}

.result-label { color: #9ca3af; font-size: 0.8rem; font-weight: 600; margin: 0; }
.total-value { display: flex; align-items: baseline; gap: 6px; margin: 0; }

.amount { 
    font-size: 1.9rem; 
    font-weight: 800; 
    color: #eab308; 
    letter-spacing: -1px; 
    line-height: 1.1; 
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.reset-icon { position: absolute; bottom: 12px; right: 14px; font-size: 1rem; color: #9ca3af; cursor: pointer; transition: color 0.3s;}
.reset-icon:hover { color: #eab308; }

/* --- Botões de Ação Universais --- */
.action-buttons { width: 100%; display: flex; flex-direction: column; gap: 8px; }

.btn { 
    width: 100%; 
    border-radius: 10px; 
    padding: 12px; 
    font-size: 0.9rem; 
    font-weight: 800; 
    cursor: pointer; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    border: none; 
    transition: transform 0.1s, box-shadow 0.2s;
    margin-top: 4px;
}

.btn:active:not(:disabled) { transform: scale(0.98); }
.btn:disabled { cursor: not-allowed; filter: grayscale(100%) opacity(0.5); transform: none; box-shadow: none !important;}

.btn-share { 
    background: linear-gradient(to bottom, #eab308, #ca8a04);
    border: 1px solid #a16207;
    color: #111827; 
    box-shadow: 0 4px 10px rgba(202, 138, 4, 0.2); 
    text-shadow: 0 1px 1px rgba(255,255,255,0.4);
}

.btn-verify { 
    background: linear-gradient(to bottom, #1f232b, #11141a);
    color: #e2e8f0; 
    border: 1px solid #374151; 
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* --- Rodapé Metálico --- */
.footer { 
    text-align: center; 
    width: 100%; 
    color: #6b7280; 
    font-size: 0.7rem; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 2px; 
    margin-top: 5px; 
}

.footer p { margin: 0; }
.guild-info.green { color: #eab308; font-weight: 700; } 
.dev-info { font-weight: 500; }
.discord-link { color: #94a3b8; text-decoration: none; display: flex; align-items: center; gap: 4px; font-weight: 600; font-size: 0.75rem; margin: 2px 0;}

/* ========================================================
   SISTEMA EXPANDIDO (Painéis Escuros Elegantes)
======================================================== */

.dark-panel {
    background: linear-gradient(to bottom, #1f232b, #11141a);
    border: 1px solid #374151;
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5), 0 4px 10px rgba(0,0,0,0.3);
    border-radius: 10px;
    padding: 12px;
    color: #e2e8f0;
    margin-bottom: 12px;
}

.dark-panel h4 { color: #eab308; margin: 0 0 10px 0; font-size: 0.9rem; display: flex; align-items: center; gap: 6px; }
.dark-panel label { color: #9ca3af; margin-bottom: 4px; font-size: 0.75rem;}

.dark-panel input[type="number"], .dark-panel input[type="text"], .dark-panel input[type="password"], .dark-panel input[type="email"], .dark-panel input[type="tel"], .dark-panel textarea { 
    background-color: #0f172a; 
    border-color: #374151; 
    color: #f8fafc; 
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3);
    font-family: inherit;
}
.dark-panel input:focus, .dark-panel textarea:focus { border-color: #eab308; background-color: #1e293b; outline: none; }
.dark-panel input:disabled { background-color: #1e293b; color: #9ca3af; border-color: transparent; opacity: 1; }

/* Grade de Métricas do Admin */
.metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.metric-box { padding: 10px 8px; margin-bottom: 0; text-align: center; display: flex; flex-direction: column; justify-content: center; align-items: center;}
.metric-box.span-2 { grid-column: span 2; }
.metric-label { color: #9ca3af; font-size: 0.7rem; text-transform: uppercase; font-weight: 700; margin: 0 0 4px 0; }
.metric-val { font-size: 1.25rem; font-weight: 900; margin: 0; text-shadow: 0 2px 4px rgba(0,0,0,0.5); }

.metric-val.blue { color: #3b82f6; }
.metric-val.gold { color: #fde047; }
.metric-val.green { color: #22c55e; }
.metric-val.silver { color: #e2e8f0; }
.metric-val.bronze { color: #eab308; }

/* Blocos Gerados pelo JS (Listas) */
#lista-ofertas > div, #caixa-vendas-container > div, #lista-meus-anuncios > div {
    background: linear-gradient(to bottom, #1f232b, #11141a) !important;
    border: 1px solid #374151 !important;
    box-shadow: inset 0 2px 5px rgba(0,0,0,0.3), 0 4px 6px rgba(0,0,0,0.2) !important;
    border-radius: 10px !important;
    color: #cbd5e1 !important;
    padding: 12px !important;
    font-size: 0.85rem !important;
}
#lista-ofertas strong, #caixa-vendas-container strong, #lista-meus-anuncios strong {
    color: #f8fafc !important;
}

#caixa-vendas-container { max-height: 180px; }

#notification-toast {
    background: linear-gradient(to bottom, #1f232b, #11141a);
    border: 1px solid #eab308;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8), 0 0 15px rgba(234, 179, 8, 0.2);
    color: #e2e8f0;
}

/* =========================================================
   MODAIS DE VERIFICAÇÃO E SUPORTE
========================================================= */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(15, 23, 42, 0.95); z-index: 999; justify-content: center; align-items: center; }
.modal-overlay.active { display: flex; }
.modal-box { background: linear-gradient(to bottom, #1f232b, #11141a); border: 1px solid #eab308; width: 90%; max-width: 320px; border-radius: 14px; padding: 20px; position: relative; text-align: center; box-shadow: 0 10px 25px rgba(0,0,0,0.8); }
.modal-close { position: absolute; top: 10px; right: 14px; color: #9ca3af; font-size: 22px; cursor: pointer; font-weight: bold; }
.modal-close:hover { color: #ef4444; }
.modal-title { color: #eab308; margin: 0 0 10px 0; font-size: 1.1rem; }
.modal-desc { color: #9ca3af; font-size: 0.8rem; margin-bottom: 16px; }
.input-serial-wrapper { display: flex; align-items: center; background-color: #0f172a; border: 1px solid #4b5563; border-radius: 8px; padding: 0 12px; margin-bottom: 15px; height: 44px; }
.input-serial-wrapper:focus-within { border-color: #eab308; }
.prefix-fixed { color: #eab308; font-weight: bold; font-family: monospace; font-size: 14px; white-space: nowrap; }
.input-serial-field { flex: 1; background: transparent; border: none; color: #e2e8f0; font-family: monospace; font-size: 14px; outline: none; padding-left: 2px; width: 100%; }
.input-serial-field::placeholder { color: #4b5563; }
.verify-action-btn { width: 100%; background: linear-gradient(to bottom, #eab308, #ca8a04); border: 1px solid #a16207; color: #111827; padding: 12px; font-weight: bold; font-size: 0.95rem; border-radius: 10px; cursor: pointer; }
.verify-result { margin-top: 12px; font-size: 0.85rem; text-align: left; padding: 10px; border-radius: 8px; display: none; }
.verify-result.success { display: block; background-color: rgba(234, 179, 8, 0.1); border: 1px solid #eab308; color: #fde047; }
.verify-result.error { display: block; background-color: rgba(239, 68, 68, 0.1); border: 1px solid #ef4444; color: #fee2e2; text-align: center; font-weight: bold; }

/* ========================================================
   NOVO: BOTÃO FLUTUANTE DE SUPORTE
======================================================== */
.fab-suporte {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 48px;
    height: 48px;
    background: linear-gradient(to bottom, #eab308, #ca8a04);
    border: 2px solid #a16207;
    border-radius: 50%;
    display: none; /* Só aparece quando logado */
    justify-content: center;
    align-items: center;
    color: #111827;
    font-size: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5), 0 0 10px rgba(234, 179, 8, 0.2);
    cursor: pointer;
    z-index: 900;
    transition: transform 0.1s;
}
.fab-suporte:active { transform: scale(0.9); }
