:root {
    --primary: var(--azul-caixa);
    --primary-dark: #002244;
    --accent: #00A859;
    --accent-hover: #008f4c;
    --danger: var(--perigo);
    --warning: #f59e0b;
    --bg: var(--fundo);
    --card-bg: var(--fundo-card);
    --text: var(--texto);
    --text-muted: var(--texto-secundario);
}

body {
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh; min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
}

.header {
    text-align: center;
    margin-bottom: 24px;
}

.header h1 {
    font-size: 24px;
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header h1 i {
    color: #25D366;
}

.header p {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 6px;
}

.card {
    background: var(--card-bg);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
    padding: 28px;
    text-align: center;
    position: relative;
    border: none;
    margin-bottom: 0;
}
@media (hover: hover) {
    .card:hover {
        transform: none;
        box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    }
}
.card:active {
    transform: none;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.status-badge.connecting {
    background: #fef3c7;
    color: #92400e;
}

.status-badge.open {
    background: #dcfce7;
    color: #166534;
}

.status-badge.close {
    background: #fee2e2;
    color: #991b1b;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: currentColor;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.4; transform: scale(0.85); }
}

.qr-wrapper {
    position: relative;
    display: inline-block;
    margin: 10px 0 16px 0;
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    min-height: 290px;
    min-width: 290px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qr-image {
    max-width: 260px;
    width: 100%;
    height: auto;
    border-radius: 4px;
    display: block;
}

.qr-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 14px;
}

.spinner {
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.instructions {
    text-align: left;
    background: #f8fafc;
    border-radius: 10px;
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text);
    margin-bottom: 16px;
    border-left: 4px solid #25D366;
    line-height: 1.5;
}

.instructions ol {
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.connected-box {
    display: none;
    padding: 10px;
    text-align: center;
}

.connected-box i.success-icon {
    font-size: 56px;
    color: var(--accent);
    margin-bottom: 12px;
}

.connected-box h2 {
    font-size: 20px;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.connected-info {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin: 16px 0;
    text-align: left;
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
    margin-top: 16px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
    width: 100%;
}

.btn-primary {
    background: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--accent);
    color: #fff;
}

.btn-success:hover {
    background: var(--accent-hover);
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-secondary {
    background: #e2e8f0;
    color: var(--text);
}

.btn-secondary:hover {
    background: #cbd5e1;
}

.tip-box {
    margin-top: 14px;
    font-size: 12px;
    color: var(--text-muted);
    background: #fefce8;
    border: 1px solid #fef08a;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: left;
    line-height: 1.4;
}

.test-msg-box {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: left;
}

.test-msg-box h4 {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.input-group {
    display: flex;
    gap: 8px;
}

.input-group input {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 16px;
}

.footer {
    margin-top: 20px;
    font-size: 12px;
    color: var(--text-muted);
    text-align: center;
}
