/* ============================================================
   VARIÁVEIS E BASE
   ============================================================ */
:root {
    --primary:        #2563eb;
    --primary-dark:   #1d4ed8;
    --primary-light:  #eff6ff;
    --success:        #16a34a;
    --success-light:  #f0fdf4;
    --danger:         #dc2626;
    --danger-light:   #fef2f2;
    --info:           #0284c7;
    --info-light:     #f0f9ff;
    --orange:         #ea580c;
    --orange-light:   #fff7ed;
    --text-primary:   #0f172a;
    --text-secondary: #475569;
    --text-muted:     #94a3b8;
    --bg:             #f1f5f9;
    --card-bg:        #ffffff;
    --border:         #e2e8f0;
    --border-focus:   #2563eb;
    --radius:         14px;
    --radius-sm:      8px;
    --shadow-sm:      0 1px 4px rgba(0, 0, 0, 0.07);
    --shadow:         0 4px 20px rgba(0, 0, 0, 0.09);
    --font:           'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   LAYOUT GERAL
   ============================================================ */
.page-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header mobile */
.page-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px 24px;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border);
}

.header-logo {
    height: 34px;
    width: auto;
    object-fit: contain;
}

/* Layout principal: aside + formulário */
.checkout-layout {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 24px 20px 32px;
    gap: 24px;
}

/* ============================================================
   ASIDE INSTITUCIONAL
   ============================================================ */
.checkout-aside {
    display: flex;
    flex-direction: column;
    gap: 18px;
    order: 2;
}

/* Logo desktop (oculto no mobile) */
.aside-logo {
    display: none;
}

.aside-logo-img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

/* Apresentação do produto */
.aside-intro {
    padding: 16px 18px;
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
    border: 1px solid #c7d9ff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.aside-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 6px;
}

.aside-desc {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.aside-desc strong {
    color: var(--primary);
    font-weight: 600;
}

/* ============================================================
   LISTA DE CONFIANÇA
   ============================================================ */
.trust-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s;
}

.trust-item:hover {
    border-color: #c7d9ff;
}

.trust-icon {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    margin-top: 1px;
}

/* Variantes de cor dos ícones */
.trust-icon--blue   { background: var(--primary-light); color: var(--primary); }
.trust-icon--orange { background: var(--orange-light);  color: var(--orange);  }
.trust-icon--green  { background: var(--success-light); color: var(--success); }
.trust-icon--purple { background: #f3e8ff;              color: #7c3aed;        }

.trust-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.trust-text strong {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.3;
}

.trust-text span {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* ============================================================
   BLOCO DE VÍDEO
   ============================================================ */
.video-block {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    box-shadow: var(--shadow-sm);
}

.video-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-label .fa {
    color: var(--primary);
    font-size: 1.1rem;
}

.video-thumb {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    background: #0f172a;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    transition: box-shadow 0.2s;
}

.video-thumb:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.video-thumb:hover .play-btn {
    background: var(--primary);
    border-color: var(--primary);
    transform: translate(-50%, -50%) scale(1.1);
}

/* Thumbnail do YouTube */
.video-thumb-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.video-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.video-thumb:hover .video-overlay {
    background: rgba(0, 0, 0, 0.18);
}

.play-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.2s ease;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

.play-btn i { margin-left: 3px; }

.video-duration {
    position: absolute;
    bottom: 8px;
    right: 10px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.9);
    background: rgba(0, 0, 0, 0.55);
    padding: 2px 7px;
    border-radius: 4px;
}

.video-iframe-container {
    display: none;
    width: 100%;
    padding-bottom: 56.25%;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: #000;
}

.video-iframe-container iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* ============================================================
   SEÇÃO DO FORMULÁRIO
   ============================================================ */
.checkout-form-section {
    display: flex;
    flex-direction: column;
    order: 1;
}

/* ============================================================
   CARD DO FORMULÁRIO
   ============================================================ */
.checkout-card {
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
}

/* ============================================================
   CABEÇALHO DO CARD (step indicators integrados)
   ============================================================ */
.card-header-custom {
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(135deg, var(--primary-light) 0%, #fff 100%);
}

.card-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 5px;
}

.card-subtitle {
    font-size: 0.93rem;
    color: var(--text-secondary);
}

/* ============================================================
   INDICADORES DE PROGRESSO (dentro do card-header)
   ============================================================ */
.step-indicators {
    display: flex;
    align-items: center;
    margin-bottom: 16px;
}

.step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.step-circle {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid var(--border);
    background: var(--card-bg);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.88rem;
    font-weight: 700;
    transition: all 0.25s ease;
}

.step-check  { display: none;  font-size: 0.85rem; }
.step-number { display: block; }

.step-item.active .step-circle {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px var(--primary-light);
}

.step-item.completed .step-circle {
    border-color: var(--success);
    background: var(--success);
    color: #fff;
}

.step-item.completed .step-check  { display: block; }
.step-item.completed .step-number { display: none;  }

.step-label {
    font-size: 0.76rem;
    font-weight: 500;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.2s;
}

.step-item.active    .step-label { color: var(--primary); font-weight: 600; }
.step-item.completed .step-label { color: var(--success); }

.step-connector {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 10px 20px;
    position: relative;
    overflow: hidden;
    border-radius: 2px;
    min-width: 40px;
}

.step-connector-fill {
    height: 100%;
    width: 0;
    background: var(--success);
    transition: width 0.4s ease;
    border-radius: 2px;
}

/* ============================================================
   ETAPAS DO FORMULÁRIO
   ============================================================ */
.checkout-step {
    padding: 24px 28px 22px;
}

.etapa-oculta { display: none !important; }

.step-header {
    margin-bottom: 20px;
}

.step-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 3px;
}

.step-desc {
    font-size: 0.87rem;
    color: var(--text-secondary);
}

/* ============================================================
   CAMPOS DO FORMULÁRIO
   ============================================================ */
.form-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.form-group-custom {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label-custom {
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-primary);
}

.required {
    color: var(--danger);
    margin-left: 1px;
}

.form-input-custom {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 0.97rem;
    font-family: var(--font);
    color: var(--text-primary);
    background: var(--card-bg);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.form-input-custom::placeholder {
    color: var(--text-muted);
    font-size: 0.92rem;
}

.form-input-custom:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

.form-input-custom.campo-erro {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.field-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.4;
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.field-hint .fa {
    margin-top: 1px;
    flex-shrink: 0;
    color: var(--info);
}

/* ============================================================
   BOTÕES
   ============================================================ */
.form-actions {
    margin-bottom: 14px;
}

.form-actions-two {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 14px;
}

.btn-primary-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 50px;
    padding: 0 24px;
    font-size: 1rem;
    font-weight: 600;
    font-family: var(--font);
    color: #fff;
    background: var(--primary);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
    -webkit-appearance: none;
    appearance: none;
}

.btn-primary-custom:hover:not(:disabled) {
    background: var(--primary-dark);
    box-shadow: 0 4px 18px rgba(37, 99, 235, 0.38);
    transform: translateY(-1px);
}

.btn-primary-custom:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}

.btn-primary-custom:disabled,
.btn-primary-custom.btn-loading {
    background: #93c5fd;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.form-actions-two .btn-primary-custom {
    flex: 1;
}

.btn-secondary-custom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 50px;
    padding: 0 20px;
    font-size: 0.9rem;
    font-weight: 500;
    font-family: var(--font);
    color: var(--text-secondary);
    background: transparent;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
    -webkit-appearance: none;
    appearance: none;
}

.btn-secondary-custom:hover {
    background: var(--bg);
    border-color: var(--text-muted);
    color: var(--text-primary);
}

/* ============================================================
   MICROCOPY
   ============================================================ */
.microcopy {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.microcopy .fa {
    font-size: 0.72rem;
    color: var(--success);
}

/* ============================================================
   TOAST NOTIFICATIONS
   ============================================================ */
.toast-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    pointer-events: none;
    max-width: 320px;
    width: calc(100% - 32px);
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 15px;
    border-radius: var(--radius-sm);
    font-size: 0.87rem;
    font-weight: 500;
    font-family: var(--font);
    box-shadow: var(--shadow);
    pointer-events: auto;
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    line-height: 1.4;
}

.toast.toast-show {
    opacity: 1;
    transform: translateX(0);
}

.toast-success { background: var(--success-light); border: 1px solid #bbf7d0; color: #14532d; }
.toast-error   { background: var(--danger-light);  border: 1px solid #fecaca; color: #7f1d1d; }
.toast-info    { background: var(--info-light);    border: 1px solid #bae6fd; color: #0c4a6e; }

.toast-icon { font-size: 1rem; flex-shrink: 0; }
.toast-success .toast-icon { color: var(--success); }
.toast-error   .toast-icon { color: var(--danger);  }
.toast-info    .toast-icon { color: var(--info);    }
.toast-msg { flex: 1; }

/* ============================================================
   DESKTOP (≥ 992px) — layout side-by-side, colunas iguais
   ============================================================ */
@media (min-width: 992px) {

    .page-header { display: none; }

    /* Contêiner principal: linha com colunas de mesma altura */
    .checkout-layout {
        flex-direction: row;
        align-items: stretch;   /* mesma altura nas duas colunas */
        padding: 28px 40px;
        gap: 36px;
    }

    /* ---- ASIDE: vira um card unificado de mesma altura que o formulário ---- */
    .checkout-aside {
        order: 1;
        width: 380px;
        flex-shrink: 0;
        gap: 0;                 /* espaço interno gerenciado por padding/border */
        display: flex;
        flex-direction: column;
        background: var(--card-bg);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        box-shadow: var(--shadow);
        padding: 22px 20px;
    }

    .aside-logo {
        display: block;
        margin-bottom: 16px;
    }

    .aside-intro {
        padding: 12px 14px;
        margin-bottom: 16px;
        border-radius: var(--radius-sm);
    }

    .aside-title {
        font-size: 1rem;
    }

    .aside-desc {
        font-size: 0.83rem;
    }

    /* Trust list: linhas simples dentro do card do aside */
    .trust-list {
        gap: 0;
        margin-bottom: 16px;
    }

    .trust-item {
        background: transparent;
        border: none;
        border-bottom: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        padding: 11px 0;
        gap: 12px;
    }

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

    .trust-icon {
        width: 32px;
        height: 32px;
        font-size: 0.88rem;
    }

    .trust-text strong { font-size: 0.86rem; }
    .trust-text span   { font-size: 0.78rem; }

    /* Video block: sem card próprio, ocupa o espaço restante do aside */
    .video-block {
        flex: 1;                /* empurra e ocupa restante da altura */
        display: flex;
        flex-direction: column;
        justify-content: flex-end;
        background: transparent;
        border: none;
        border-top: 1px solid var(--border);
        border-radius: 0;
        box-shadow: none;
        padding: 14px 0 0;
    }

    .video-label {
        font-size: 0.87rem;
        margin-bottom: 8px;
    }

    /* ---- FORMULÁRIO: ocupa todo espaço restante (sem max-width) ---- */
    .checkout-form-section {
        order: 2;
        flex: 1;                /* cresce para preencher todo espaço disponível */
        display: flex;
        flex-direction: column;
    }

    /* Card do formulário estica para preencher a altura da coluna */
    .checkout-card {
        flex: 1;
        display: flex;
        flex-direction: column;
    }

    .checkout-step {
        flex: 1;               /* conteúdo alinhado ao topo, card estica */
        padding: 22px 28px 20px;
    }

    .card-header-custom {
        padding: 20px 28px 16px;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .step-header {
        margin-bottom: 18px;
    }

    .form-fields {
        gap: 14px;
        margin-bottom: 18px;
    }

    .form-actions,
    .form-actions-two {
        margin-bottom: 12px;
    }

    .btn-primary-custom,
    .btn-secondary-custom {
        height: 48px;
    }
}

/* ============================================================
   TABLET (≥ 640px < 992px)
   ============================================================ */
@media (min-width: 640px) and (max-width: 991px) {
    .checkout-layout {
        padding: 24px 28px 36px;
    }

    .checkout-form-section {
        max-width: 500px;
        margin: 0 auto;
        width: 100%;
    }
}

/* ============================================================
   MOBILE (< 480px)
   ============================================================ */
@media (max-width: 479px) {
    .checkout-layout {
        padding: 16px 14px 32px;
        gap: 18px;
    }

    .card-header-custom {
        padding: 18px 18px 14px;
    }

    .card-title {
        font-size: 1.2rem;
    }

    .checkout-step {
        padding: 20px 18px 18px;
    }

    .form-actions-two {
        flex-direction: column-reverse;
    }

    .form-actions-two .btn-secondary-custom,
    .btn-secondary-custom {
        width: 100%;
        justify-content: center;
    }

    .aside-intro {
        padding: 14px 16px;
    }

    .aside-title {
        font-size: 1rem;
    }
}
