/* ============================================================
   Serviços Cotação Pay — CSS Público
   Versão: 1.0.0
   ============================================================ */

/* ── Reset / Base ─────────────────────────────────────────── */
.scp-app *,
.scp-app *::before,
.scp-app *::after {
    box-sizing: border-box;
}

.scp-app {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.6;
    color: #1a1a2e;
    max-width: 1000px;
    margin: 0 auto;
    padding: 10px 0 40px;
}

/* ── Steps ────────────────────────────────────────────────── */
.scp-step {
    animation: scpFadeIn 0.3s ease;
}

@keyframes scpFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

.scp-step-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e8ecf0;
}

.scp-step-header h2 {
    margin: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    flex: 1;
}

.scp-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: #c0392b;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}

/* ── Botão Voltar ─────────────────────────────────────────── */
.scp-btn-voltar {
    background: none;
    border: 1px solid #c0c7d0;
    color: #c0392b;
    padding: 6px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s;
}

.scp-btn-voltar:hover {
    background: #fdf2f2;
    border-color: #c0392b;
}

/* ── Grid de Serviços ─────────────────────────────────────── */
.scp-servicos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.scp-servico-card {
    background: #fff;
    border: 2px solid #e8ecf0;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scp-servico-card:hover {
    border-color: #c0392b;
    box-shadow: 0 4px 24px rgba(192, 57, 43, 0.12);
    transform: translateY(-2px);
}

.scp-servico-card.scp-selecionado {
    border-color: #c0392b;
    background: #fff5f5;
}

.scp-servico-icon {
    font-size: 36px;
}

.scp-servico-icon svg {
    width: 48px;
    height: 48px;
    display: block;
    margin: 0 auto;
}

/* Imagem da biblioteca: banner limitado a 240x100 px */
.scp-servico-img-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 60px;
    padding: 4px 0;
}

.scp-servico-img-banner img {
    max-width: 240px;
    max-height: 100px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.scp-servico-nome {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.scp-servico-desc {
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
}

.scp-servico-valor-base {
    font-size: 13px;
    color: #6b7280;
}

.scp-servico-valor-base strong {
    color: #c0392b;
    font-size: 16px;
}

/* ── Layout dois colunas ──────────────────────────────────── */
.scp-layout-dois-col {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 24px;
    align-items: start;
}

@media (max-width: 720px) {
    .scp-layout-dois-col {
        grid-template-columns: 1fr;
    }
    .scp-col-direita {
        order: -1;
    }
}

/* ── Card ─────────────────────────────────────────────────── */
.scp-card {
    background: #fff;
    border: 1px solid #e8ecf0;
    border-radius: 12px;
    padding: 24px;
}

.scp-card h3 {
    margin: 0 0 16px;
    font-size: 1rem;
    font-weight: 700;
    color: #1a1a2e;
}

.scp-resumo-fixo {
    position: sticky;
    top: 20px;
}

/* ── Campos dinâmicos ─────────────────────────────────────── */
.scp-campo-item {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f2f5;
}

.scp-campo-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.scp-campo-label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 8px;
}

.scp-campo-label .scp-required {
    color: #ef4444;
    margin-left: 3px;
}

.scp-campo-descricao {
    font-size: 12px;
    color: #9ca3af;
    margin-top: 4px;
}

/* ── Inputs ───────────────────────────────────────────────── */
.scp-input,
.scp-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 15px;
    color: #1a1a2e;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    font-family: inherit;
}

.scp-input:focus,
.scp-select:focus {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.15);
}

.scp-input[type="number"] {
    max-width: 160px;
}

/* Checkbox personalizado */
.scp-checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
}

.scp-checkbox-wrapper input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: #c0392b;
    cursor: pointer;
    flex-shrink: 0;
}

.scp-checkbox-wrapper label {
    cursor: pointer;
    font-size: 15px;
    color: #374151;
}

/* ── Formulário do cliente ────────────────────────────────── */
.scp-form-group {
    margin-bottom: 16px;
}

.scp-form-group label {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #374151;
    margin-bottom: 6px;
}

.scp-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 480px) {
    .scp-form-row { grid-template-columns: 1fr; }
}

/* ── Valor Total ──────────────────────────────────────────── */
.scp-valor-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: #fff5f5;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 15px;
    color: #374151;
}

.scp-valor-total strong {
    font-size: 1.4rem;
    color: #c0392b;
    font-weight: 800;
}

/* ── Itens de cálculo ─────────────────────────────────────── */
.scp-itens-calculo {
    margin-bottom: 16px;
    font-size: 13px;
    color: #6b7280;
}

.scp-item-calculo {
    display: flex;
    justify-content: space-between;
    padding: 4px 0;
    border-bottom: 1px dashed #e8ecf0;
}

.scp-item-calculo:last-child {
    border-bottom: none;
}

/* ── Botões ───────────────────────────────────────────────── */
.scp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 22px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    text-decoration: none;
    transition: all 0.2s;
    font-family: inherit;
}

.scp-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.scp-btn-primary {
    background: #c0392b;
    color: #fff;
}

.scp-btn-primary:hover:not(:disabled) {
    background: #a93226;
    box-shadow: 0 4px 12px rgba(192, 57, 43, 0.35);
    transform: translateY(-1px);
}

.scp-btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.scp-btn-secondary:hover:not(:disabled) {
    background: #e5e7eb;
}

.scp-btn-success {
    background: #10b981;
    color: #fff;
}

.scp-btn-success:hover:not(:disabled) {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.scp-btn-block {
    width: 100%;
}

/* ── Formas de pagamento ──────────────────────────────────── */
.scp-forma-pgto-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 24px;
}

.scp-forma-pgto-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 18px 14px;
    border: 2px solid #e8ecf0;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.scp-forma-pgto-card:hover {
    border-color: #c0392b;
    background: #fff5f5;
}

.scp-forma-pgto-card.scp-forma-selecionada,
.scp-forma-pgto-card:has(input:checked) {
    border-color: #c0392b;
    background: #fdf2f2;
}

.scp-forma-pgto-card input[type="radio"] {
    display: none;
}

.scp-pgto-icon {
    font-size: 28px;
}

.scp-pgto-nome {
    font-weight: 700;
    font-size: 15px;
    color: #1a1a2e;
}

.scp-forma-pgto-card small {
    font-size: 12px;
    color: #9ca3af;
}

/* ── Dados de pagamento ───────────────────────────────────── */
.scp-pgto-dados {
    border-top: 1px solid #e8ecf0;
    padding-top: 20px;
    margin-top: 8px;
    animation: scpFadeIn 0.3s ease;
}

.scp-instrucao {
    margin: 0 0 12px;
    font-size: 14px;
    color: #374151;
}

.scp-pix-wrapper {
    text-align: center;
}

.scp-qrcode-wrapper {
    margin: 16px auto;
    max-width: 200px;
    padding: 12px;
    border: 1px solid #e8ecf0;
    border-radius: 8px;
    background: #fff;
}

.scp-qrcode-wrapper img {
    width: 100%;
    height: auto;
    display: block;
}

.scp-copiar-wrapper {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.scp-copiar-wrapper .scp-input {
    flex: 1;
    font-size: 12px;
    font-family: monospace;
    background: #f9fafb;
}

.scp-copiar-wrapper .scp-btn {
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Status badge ─────────────────────────────────────────── */
.scp-status-badge {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 16px;
    width: 100%;
    text-align: center;
}

.scp-status-pending  { background: #fef3c7; color: #92400e; }
.scp-status-waiting  { background: #dbeafe; color: #1e40af; }
.scp-status-paid     { background: #d1fae5; color: #065f46; }
.scp-status-expired  { background: #fee2e2; color: #991b1b; }

/* ── Alerta / Mensagens ───────────────────────────────────── */
.scp-alert {
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.scp-alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }
.scp-alert-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.scp-alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }

/* ── Spinner ──────────────────────────────────────────────── */
.scp-spinner-ring {
    width: 40px;
    height: 40px;
    border: 4px solid #e8ecf0;
    border-top-color: #c0392b;
    border-radius: 50%;
    animation: scpSpin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes scpSpin {
    to { transform: rotate(360deg); }
}

/* ── Tela de sucesso ──────────────────────────────────────── */
.scp-sucesso-wrapper {
    text-align: center;
    padding: 60px 20px;
}

.scp-sucesso-icon {
    font-size: 64px;
    margin-bottom: 20px;
    animation: scpBounce 0.5s ease;
}

@keyframes scpBounce {
    0%   { transform: scale(0.5); opacity: 0; }
    70%  { transform: scale(1.1); }
    100% { transform: scale(1);   opacity: 1; }
}

.scp-sucesso-wrapper h2 {
    font-size: 1.8rem;
    color: #065f46;
    margin-bottom: 12px;
}

.scp-sucesso-wrapper p {
    color: #6b7280;
    font-size: 15px;
    max-width: 480px;
    margin: 0 auto 10px;
}

.scp-sucesso-banner {
    background: #d1fae5;
    color: #065f46;
    padding: 14px 20px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
}

/* ── Resumo linha ─────────────────────────────────────────── */
.scp-resumo-linha {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 12px;
}

/* ── Tabela detalhe ───────────────────────────────────────── */
.scp-table-detalhe {
    width: 100%;
    border-collapse: collapse;
    margin-top: 16px;
}

.scp-table-detalhe th,
.scp-table-detalhe td {
    padding: 10px 14px;
    border-bottom: 1px solid #e8ecf0;
    text-align: left;
    font-size: 14px;
}

.scp-table-detalhe th {
    width: 160px;
    color: #6b7280;
    font-weight: 600;
}

/* ── Badges públicos ──────────────────────────────────────── */
.scp-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.scp-badge.scp-status-pending  { background: #fef3c7; color: #92400e; }
.scp-badge.scp-status-waiting  { background: #dbeafe; color: #1e40af; }
.scp-badge.scp-status-paid     { background: #d1fae5; color: #065f46; }
.scp-badge.scp-status-expired  { background: #fee2e2; color: #991b1b; }
