/* Estilos compartilhados - Fluxo cliente */
* { margin: 0; padding: 0; box-sizing: border-box; }

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

:root {
    --wpp: #25D366;
    --wpp-dark: #128C7E;
    --wpp-header: #075E54;
    --bubble: #DCF8C6;
    --bg: #E5DDD5;
    --text: #3B4A54;
    --text-light: #667781;
}

body {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 0L30 60M0 30L60 30' stroke='%23d1c4b8' stroke-width='0.5' fill='none'/%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
    z-index: 0;
}

.site-header {
    position: relative;
    z-index: 1;
    background: var(--wpp-header);
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.site-header .brand { text-decoration: none; }
.logo-wrap {
    background: white;
    padding: 6px 12px;
    border-radius: 10px;
}
.logo-img { height: 32px; width: auto; display: block; }
.brand-fallback { color: var(--wpp-header); font-weight: 700; }

/* Marca: emoji de chat + DivulgaZap */
.logo-wrap.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
}
.brand-emoji {
    font-size: 1.65rem;
    line-height: 1;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.06));
}
.brand-name-styled {
    display: inline-flex;
    align-items: baseline;
    font-weight: 800;
    font-size: 1.2rem;
    letter-spacing: -0.04em;
    line-height: 1;
}
.brand-name-divulga { color: var(--wpp-header); }
.brand-name-zap {
    background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-header {
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}
.btn-header.btn-primary {
    background: var(--wpp);
    color: white !important;
}
.btn-header.btn-primary:hover { background: #20bd5a; }
.btn-header.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white !important;
}
.btn-header.btn-outline:hover { background: rgba(255,255,255,0.2); }

main { position: relative; z-index: 1; }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
}
@media (max-width: 900px) { .plans-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px) { .plans-grid { grid-template-columns: 1fr; } }

.plan-card {
    background: white;
    border-radius: 12px;
    padding: 28px 24px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
    border-left: 4px solid var(--wpp);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.plan-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}
.plan-card.plan-popular {
    border-left-color: var(--wpp-dark);
    background: linear-gradient(180deg, #E8F5E9 0%, white 100%);
}
.plan-badge {
    background: var(--wpp);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    margin-bottom: 12px;
}
.plan-dur { font-size: 0.9rem; color: var(--text-light); margin-bottom: 8px; }
.plan-price { font-size: 2rem; font-weight: 800; color: var(--wpp-header); margin-bottom: 8px; }
.plan-desc { font-size: 0.85rem; color: var(--text-light); margin-bottom: 20px; }
.plan-btn {
    display: block;
    text-align: center;
    padding: 14px 20px;
    background: var(--wpp-header);
    color: white !important;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.3s ease;
}
.plan-card.plan-popular .plan-btn { background: var(--wpp); }
.plan-btn:hover { opacity: 0.95; }

.cta-section {
    text-align: center;
    padding: 40px;
}
.cta-section a { color: var(--wpp-dark); font-weight: 600; text-decoration: none; }

/* Páginas de cadastro / login */
body.auth-page {
    background: linear-gradient(165deg, #e8f5f0 0%, var(--bg) 45%, #f0ebe3 100%);
}
body.auth-page::before {
    opacity: 0.35;
}

.auth-shell {
    max-width: 440px;
    margin: 0 auto;
    padding: 28px 18px 56px;
}

.form-card {
    max-width: 480px;
    margin: 40px auto 60px;
    padding: 40px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}

body.auth-page .auth-shell .form-card {
    margin: 0;
    padding: 32px 28px 36px;
    border-radius: 20px;
    border: 1px solid rgba(7, 94, 84, 0.08);
    box-shadow:
        0 4px 6px -1px rgba(7, 94, 84, 0.06),
        0 24px 48px -12px rgba(7, 94, 84, 0.12);
    position: relative;
    overflow: hidden;
}
body.auth-page .form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--wpp), var(--wpp-dark));
}

.auth-pill {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--wpp-dark);
    background: rgba(37, 211, 102, 0.15);
    padding: 6px 12px;
    border-radius: 999px;
    margin-bottom: 14px;
}

.form-card h1 { font-size: 1.5rem; color: var(--wpp-header); margin-bottom: 8px; }
body.auth-page .form-card h1 {
    font-size: clamp(1.35rem, 4vw, 1.6rem);
    letter-spacing: -0.02em;
    line-height: 1.2;
}
.form-card .sub { color: var(--text-light); margin-bottom: 28px; font-size: 0.95rem; }
body.auth-page .form-card .sub {
    line-height: 1.55;
    margin-bottom: 24px;
}

.form-group { margin-bottom: 18px; }
.form-group label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.88rem;
    color: var(--text);
}
.form-group .label-hint {
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--text-light);
}
.form-group input, .form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
}
body.auth-page .form-group input,
body.auth-page .form-group select {
    border-radius: 12px;
    border-color: #dfe8e4;
    padding: 13px 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus {
    outline: none;
    border-color: var(--wpp);
}
body.auth-page .form-group input:focus {
    box-shadow: 0 0 0 3px rgba(37, 211, 102, 0.2);
}

.field-password {
    position: relative;
}
.field-password input {
    padding-right: 48px !important;
}
.pwd-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: #f0f4f2;
    color: var(--wpp-header);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background 0.2s;
}
.pwd-toggle:hover { background: #e0ebe7; }
.pwd-toggle:focus-visible {
    outline: 2px solid var(--wpp);
    outline-offset: 2px;
}

.form-submit {
    width: 100%;
    padding: 16px;
    background: var(--wpp);
    color: white !important;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: background 0.3s ease, transform 0.15s;
}
body.auth-page .form-submit {
    border-radius: 14px;
    padding: 15px 20px;
    font-weight: 700;
    margin-top: 12px;
    box-shadow: 0 8px 20px rgba(37, 211, 102, 0.35);
}
.form-submit:hover:not(:disabled) { background: var(--wpp-dark); }
body.auth-page .form-submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 10px 28px rgba(37, 211, 102, 0.4);
}
.form-submit:active:not(:disabled) { transform: translateY(0); }
.form-submit:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}
.form-submit.is-loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}
.form-submit.is-loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    border: 3px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}
@keyframes auth-spin {
    to { transform: rotate(360deg); }
}

.form-footer { text-align: center; margin-top: 24px; font-size: 0.9rem; color: var(--text-light); }
.form-footer a { color: var(--wpp-dark); font-weight: 600; text-decoration: none; }
.form-footer a:hover { text-decoration: underline; }

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0 0;
    font-size: 0.85rem;
    color: var(--text-light);
}
.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #dfe8e4;
}
.auth-alt-link {
    display: block;
    text-align: center;
    margin-top: 14px;
    font-size: 0.95rem;
}
.auth-alt-link a {
    color: var(--wpp-header);
    font-weight: 700;
    text-decoration: none;
}
.auth-alt-link a:hover { text-decoration: underline; }

/* Cadastro / login — navegação rápida */
.auth-quick-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 20px;
}
.auth-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    color: var(--wpp-header);
    background: rgba(37, 211, 102, 0.12);
    border: 1px solid rgba(7, 94, 84, 0.12);
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.auth-chip:hover {
    background: rgba(37, 211, 102, 0.22);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(7, 94, 84, 0.1);
}
.auth-chip:active { transform: translateY(0); }

.signup-progress-wrap {
    margin-bottom: 20px;
}
.signup-progress-label {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-light);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.signup-progress {
    height: 6px;
    border-radius: 999px;
    background: #e8ece9;
    overflow: hidden;
}
.signup-progress span {
    display: block;
    height: 100%;
    width: 0%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--wpp), var(--wpp-dark));
    transition: width 0.35s ease;
}

.signup-extra {
    margin-bottom: 16px;
    border: 1px dashed #cfe5dc;
    border-radius: 12px;
    padding: 0 4px;
    background: #fafcfb;
}
.signup-extra summary {
    list-style: none;
    cursor: pointer;
    padding: 12px 14px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--wpp-header);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.signup-extra summary::-webkit-details-marker { display: none; }
.signup-extra summary::after {
    content: '▾';
    font-size: 0.75rem;
    opacity: 0.7;
    transition: transform 0.2s;
}
.signup-extra[open] summary::after { transform: rotate(-180deg); }
.signup-extra .opt {
    font-weight: 500;
    font-size: 0.78rem;
    color: var(--text-light);
}
.signup-extra .form-group {
    padding: 0 12px 12px;
    margin-bottom: 0;
}

body.auth-page .form-group input.input-ok {
    border-color: rgba(37, 211, 102, 0.65);
    background: linear-gradient(180deg, #f8fffb 0%, #fff 100%);
}

.msg { padding: 12px 16px; border-radius: 8px; margin-bottom: 20px; }
body.auth-page .msg { border-radius: 12px; font-size: 0.92rem; line-height: 1.45; }
.msg.success { background: #d4edda; color: #155724; }
.msg.info { background: #cce5ff; color: #004085; }
.msg.error { background: #f8d7da; color: #721c24; }
.msg.error a { color: #721c24; font-weight: 600; text-decoration: underline; }
