/* Modal de WhatsApp único do site riano.com.br (componente compartilhado).
   HTML injetado por /assets/wa-modal.js. Variáveis com fallback: funciona em
   páginas que não definem o tema da landing (cnpj, blog). */

.wam-root {
    --wam-card: var(--dark-card, #111827);
    --wam-border: var(--dark-border, #1F2937);
    --wam-bg: var(--dark-bg, #0A0E1A);
    --wam-text: var(--text-primary, #F9FAFB);
    --wam-muted: var(--text-secondary, #9CA3AF);
    --wam-verde: var(--verde-riano, #6EBE44);
    --wam-gradient: var(--gradient-primary, linear-gradient(135deg, #6EBE44 0%, #44BEBE 100%));
    --wam-erro: #F87171;
}

/* Botão flutuante (landing e portfolio) */
.wam-float {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    z-index: 999;
    transition: transform 0.25s ease;
    border: none;
    text-decoration: none;
}

.wam-float:hover {
    transform: scale(1.08);
}

.wam-float svg {
    width: 32px;
    height: 32px;
    fill: white;
}

.wam-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 26, 0.75);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
    box-sizing: border-box;
}

.wam-overlay.active {
    display: flex;
}

.wam-root,
.wam-root * {
    box-sizing: border-box;
}

.wam-dialog {
    background: var(--wam-card);
    border: 1px solid var(--wam-border);
    border-radius: 16px;
    width: 100%;
    max-width: 380px;
    max-height: 100%;
    overflow-y: auto;
    padding: 2rem;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    font-family: inherit;
    color: var(--wam-text);
}

.wam-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: var(--wam-muted);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
}

.wam-close:hover {
    color: var(--wam-text);
}

.wam-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.wam-icon-circle {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--wam-gradient);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.wam-icon-circle svg {
    width: 28px;
    height: 28px;
    fill: white;
}

.wam-header h3 {
    font-size: 1.25rem;
    margin: 0 0 0.5rem;
    color: var(--wam-text);
}

.wam-header p {
    margin: 0;
    color: var(--wam-muted);
    font-size: 0.9rem;
}

.wam-form input {
    display: block;
    width: 100%;
    padding: 0.85rem 1rem;
    margin: 0 0 0.85rem;
    background: var(--wam-bg);
    border: 1px solid var(--wam-border);
    border-radius: 10px;
    color: var(--wam-text);
    font-size: 0.95rem;
    font-family: inherit;
}

.wam-form input::placeholder {
    color: var(--wam-muted);
}

.wam-form input:focus {
    outline: none;
    border-color: var(--wam-verde);
}

.wam-form input.wam-invalid {
    border-color: var(--wam-erro);
    margin-bottom: 0.35rem;
}

.wam-field-error {
    color: var(--wam-erro);
    font-size: 0.8rem;
    margin: 0 0 0.85rem;
}

.wam-field-error[hidden] {
    display: none;
}

.wam-form-error {
    color: var(--wam-erro);
    font-size: 0.85rem;
    margin: 0 0 0.85rem;
    text-align: center;
}

.wam-form-error[hidden] {
    display: none;
}

.wam-submit {
    width: 100%;
    padding: 0.9rem;
    background: var(--wam-gradient);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: opacity 0.2s ease;
}

.wam-submit:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

@media (max-width: 400px) {
    .wam-dialog {
        padding: 1.5rem 1.25rem;
    }
}
