/* ==========================================================================
   checkout.css — Página de Checkout Premium
   Autocontido: tokens próprios + herda tokens base do landing.css
   Design: Glassmorphism + micro-animações + mobile-first
   ========================================================================== */

/* ──────────────────────────────────────────────────────────────────────────
   TOKENS EXTRAS PARA CHECKOUT
   ────────────────────────────────────────────────────────────────────────── */
:root,
[data-lp-theme="light"] {
    --ck-accent: #16a34a;
    --ck-accent-light: #22c55e;
    --ck-accent-glow: rgba(34, 197, 94, 0.25);
    --ck-accent-surface: rgba(34, 197, 94, 0.08);

    --ck-step-inactive-bg: #e5e7eb;
    --ck-step-inactive-text: #9ca3af;
    --ck-step-active-bg: linear-gradient(135deg, #22c55e, #16a34a);
    --ck-step-connector: #e5e7eb;
    --ck-step-connector-done: #22c55e;

    --ck-summary-bg: #f8faf8;
    --ck-summary-border: rgba(0, 0, 0, 0.06);
    --ck-item-border: #f0f0f0;
    --ck-price-color: #1a1a2e;
    --ck-original-price: #9ca3af;
    --ck-discount-bg: rgba(34, 197, 94, 0.08);
    --ck-discount-text: #16a34a;

    --ck-coupon-bg: #f9fafb;
    --ck-coupon-border: #e5e7eb;

    --ck-badge-bg: rgba(0, 0, 0, 0.04);
    --ck-badge-text: #6b7280;
    --ck-badge-icon: #9ca3af;

    --ck-installment-bg: #ffffff;
    --ck-installment-border: #e5e7eb;
    --ck-installment-hover: rgba(34, 197, 94, 0.06);
}

[data-lp-theme="dark"] {
    --ck-accent: #22c55e;
    --ck-accent-light: #4ade80;
    --ck-accent-glow: rgba(34, 197, 94, 0.30);
    --ck-accent-surface: rgba(34, 197, 94, 0.10);

    --ck-step-inactive-bg: rgba(255, 255, 255, 0.08);
    --ck-step-inactive-text: rgba(255, 255, 255, 0.35);
    --ck-step-active-bg: linear-gradient(135deg, #22c55e, #16a34a);
    --ck-step-connector: rgba(255, 255, 255, 0.08);
    --ck-step-connector-done: #22c55e;

    --ck-summary-bg: rgba(255, 255, 255, 0.03);
    --ck-summary-border: rgba(255, 255, 255, 0.06);
    --ck-item-border: rgba(255, 255, 255, 0.06);
    --ck-price-color: #e8eaf6;
    --ck-original-price: rgba(255, 255, 255, 0.35);
    --ck-discount-bg: rgba(34, 197, 94, 0.12);
    --ck-discount-text: #4ade80;

    --ck-coupon-bg: rgba(255, 255, 255, 0.04);
    --ck-coupon-border: rgba(255, 255, 255, 0.08);

    --ck-badge-bg: rgba(255, 255, 255, 0.05);
    --ck-badge-text: rgba(255, 255, 255, 0.50);
    --ck-badge-icon: rgba(255, 255, 255, 0.30);

    --ck-installment-bg: rgba(255, 255, 255, 0.04);
    --ck-installment-border: rgba(255, 255, 255, 0.06);
    --ck-installment-hover: rgba(34, 197, 94, 0.08);
}

/* ──────────────────────────────────────────────────────────────────────────
   LAYOUT PRINCIPAL — Single Fold
   ────────────────────────────────────────────────────────────────────────── */
.ck-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 24px 16px 32px;
}

.ck-header {
    background: var(--lp-card-bg);
    border-bottom: 1px solid var(--lp-card-border);
    padding: 12px 0;
    transition: background 0.3s, border-color 0.3s;
}

.ck-header__inner {
    max-width: 560px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ck-header__logo {
    max-height: 40px;
    object-fit: contain;
}

/* ──────────────────────────────────────────────────────────────────────────
   CARD ÚNICO
   ────────────────────────────────────────────────────────────────────────── */
.ck-card {
    background: var(--lp-card-bg);
    border-radius: 18px;
    box-shadow: var(--lp-card-shadow);
    border: 1px solid var(--lp-card-border);
    overflow: hidden;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 16px;
    animation: ckFadeUp 0.45s ease both;
}

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

/* ──────────────────────────────────────────────────────────────────────────
   RESUMO COMPACTO (topo do card)
   ────────────────────────────────────────────────────────────────────────── */
.ck-summary {
    padding: 18px 22px 14px;
}

.ck-summary__product {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ck-summary__icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--ck-accent-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    color: var(--ck-accent);
}

.ck-summary__info {
    flex: 1;
    min-width: 0;
}

.ck-summary__name {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--lp-text);
    line-height: 1.3;
    transition: color 0.3s;
}

.ck-summary__desc {
    font-size: 0.72rem;
    color: var(--lp-text-muted);
    margin-top: 2px;
    line-height: 1.4;
    transition: color 0.3s;
}

.ck-summary__price {
    text-align: right;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.ck-summary__price-old {
    font-size: 0.72rem;
    color: var(--ck-original-price);
    text-decoration: line-through;
}

.ck-summary__price-now {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--ck-accent);
}

/* Discount & installment badges */
.ck-summary__discount,
.ck-summary__installment {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 8px;
}

.ck-summary__discount {
    background: var(--ck-discount-bg);
    color: var(--ck-discount-text);
}

.ck-summary__installment {
    background: var(--ck-accent-surface);
    color: var(--ck-accent);
    margin-left: 4px;
}

/* ──────────────────────────────────────────────────────────────────────────
   CUPOM (compacto)
   ────────────────────────────────────────────────────────────────────────── */
.ck-coupon-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 0;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--ck-accent);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    transition: opacity 0.2s;
    margin-top: 6px;
}

.ck-coupon-trigger:hover { opacity: 0.8; }

.ck-coupon-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
    opacity: 0;
}

.ck-coupon-panel--open {
    max-height: 120px;
    opacity: 1;
}

.ck-coupon-form {
    display: flex;
    gap: 8px;
    padding: 8px 0 4px;
}

.ck-coupon-input {
    flex: 1;
    padding: 9px 12px;
    border: 1.5px solid var(--ck-coupon-border);
    border-radius: 8px;
    background: var(--ck-coupon-bg);
    color: var(--lp-text);
    font-size: 0.82rem;
    font-family: inherit;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.ck-coupon-input:focus {
    border-color: var(--ck-accent);
    box-shadow: 0 0 0 3px var(--ck-accent-glow);
}

.ck-coupon-input::placeholder {
    text-transform: none;
    letter-spacing: 0;
    color: var(--lp-input-placeholder);
}

.ck-coupon-btn {
    padding: 9px 16px;
    border: none;
    border-radius: 8px;
    background: var(--ck-accent);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.2s;
    white-space: nowrap;
}

.ck-coupon-btn:hover { opacity: 0.9; }
.ck-coupon-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.ck-coupon-msg {
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 0.76rem;
    font-weight: 500;
    margin: 8px 0 4px;
    display: flex;
    align-items: center;
    gap: 6px;
    animation: ckFadeUp 0.3s ease;
}

.ck-coupon-msg--success {
    background: var(--ck-discount-bg);
    color: var(--ck-discount-text);
}

.ck-coupon-msg--error {
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
}

/* ──────────────────────────────────────────────────────────────────────────
   DIVISOR
   ────────────────────────────────────────────────────────────────────────── */
.ck-divider {
    height: 1px;
    background: var(--ck-item-border);
    margin: 0 22px;
}

/* ──────────────────────────────────────────────────────────────────────────
   AREA DO FORMULÁRIO
   ────────────────────────────────────────────────────────────────────────── */
.ck-form-area {
    padding: 16px 22px 22px;
}

.ck-form-area__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--lp-text);
    margin-bottom: 14px;
    transition: color 0.3s;
}

.ck-form-area__title i {
    color: var(--ck-accent);
    font-size: 0.88rem;
}

/* ──────────────────────────────────────────────────────────────────────────
   FORMULÁRIO — Grid 2x2
   ────────────────────────────────────────────────────────────────────────── */
.ck-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ck-form-grid .ck-field--full {
    grid-column: 1 / -1;
}

.ck-field {
    margin-bottom: 0;
}

.ck-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--lp-label);
    margin-bottom: 4px;
    letter-spacing: 0.02em;
    transition: color 0.3s;
}

.ck-label .ck-required {
    color: #ef4444;
    margin-left: 2px;
}

.ck-input-wrap {
    display: flex;
    align-items: stretch;
    border: 1.5px solid var(--lp-input-border);
    border-radius: 9px;
    background: var(--lp-input-bg);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    overflow: hidden;
}

.ck-input-wrap:focus-within {
    border-color: var(--ck-accent);
    box-shadow: 0 0 0 3px var(--ck-accent-glow);
    background: var(--lp-input-bg-focus);
}

.ck-input-wrap--error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12) !important;
}

.ck-input-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 10px;
    color: var(--lp-icon-color);
    font-size: 0.82rem;
    flex-shrink: 0;
    transition: color 0.2s;
}

.ck-input-wrap:focus-within .ck-input-icon {
    color: var(--ck-accent);
}

.ck-input-wrap--error .ck-input-icon {
    color: #ef4444;
}

.ck-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 12px 10px 0;
    font-size: 0.85rem;
    color: var(--lp-input-text);
    font-family: inherit;
    transition: color 0.3s;
    min-width: 0;
}

.ck-input::placeholder {
    color: var(--lp-input-placeholder);
}

.ck-field-error {
    display: none;
    font-size: 0.68rem;
    color: #ef4444;
    font-weight: 500;
    margin-top: 3px;
    padding-left: 2px;
    animation: ckShake 0.35s ease;
}

.ck-field--has-error .ck-field-error {
    display: block;
}

.ck-field--valid .ck-input-wrap {
    border-color: var(--ck-accent);
}

.ck-field--valid .ck-input-icon {
    color: var(--ck-accent);
}

@keyframes ckShake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-4px); }
    40% { transform: translateX(4px); }
    60% { transform: translateX(-3px); }
    80% { transform: translateX(3px); }
}

/* ──────────────────────────────────────────────────────────────────────────
   BOTÃO CTA
   ────────────────────────────────────────────────────────────────────────── */
.ck-btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 14px 20px;
    margin-top: 16px;
    background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 700;
    font-family: inherit;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s;
    box-shadow: 0 6px 24px var(--ck-accent-glow);
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}

.ck-btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.18), transparent);
    opacity: 0;
    transition: opacity 0.2s;
}

.ck-btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 10px 32px var(--ck-accent-glow);
}

.ck-btn-submit:hover::before { opacity: 1; }
.ck-btn-submit:active:not(:disabled) { transform: scale(0.99); }
.ck-btn-submit:disabled { opacity: 0.6; cursor: not-allowed; transform: none; }

.ck-btn-submit .ck-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ckSpin 0.7s linear infinite;
    display: none;
    flex-shrink: 0;
}

.ck-btn-submit.ck-loading .ck-spinner { display: block; }
.ck-btn-submit.ck-loading .ck-btn-text { opacity: 0.65; }

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

/* ──────────────────────────────────────────────────────────────────────────
   TRUST ROW (inline sob o botão)
   ────────────────────────────────────────────────────────────────────────── */
.ck-trust-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-top: 12px;
    padding: 2px 0;
}

.ck-trust-row span {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--ck-badge-text);
    transition: color 0.3s;
}

.ck-trust-row i {
    font-size: 0.72rem;
    color: var(--ck-badge-icon);
    transition: color 0.3s;
}

.ck-trust-row span:first-child i {
    color: var(--ck-accent);
}

/* ──────────────────────────────────────────────────────────────────────────
   ESTADO VAZIO / ERRO
   ────────────────────────────────────────────────────────────────────────── */
.ck-empty {
    text-align: center;
    padding: 36px 24px;
}

.ck-empty__icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--ck-accent-surface);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: var(--ck-accent);
    margin: 0 auto 16px;
}

.ck-empty__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--lp-text);
    margin-bottom: 6px;
    transition: color 0.3s;
}

.ck-empty__text {
    font-size: 0.85rem;
    color: var(--lp-text-muted);
    line-height: 1.5;
    margin-bottom: 16px;
    transition: color 0.3s;
}

.ck-empty__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--ck-accent);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: opacity 0.2s;
}

.ck-empty__link:hover { opacity: 0.8; }

/* ──────────────────────────────────────────────────────────────────────────
   CHECKOUT FOOTER IMAGE
   ────────────────────────────────────────────────────────────────────────── */
.ck-footer-image {
    text-align: center;
    padding: 12px 0 0;
}

.ck-footer-image img {
    max-width: 240px;
    width: 80%;
    opacity: 0.8;
    transition: opacity 0.3s;
}

.ck-footer-image img:hover { opacity: 1; }

/* ──────────────────────────────────────────────────────────────────────────
   ALERT TOAST (INLINE)
   ────────────────────────────────────────────────────────────────────────── */
.ck-alert {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-bottom: 12px;
    animation: ckFadeUp 0.3s ease;
    border: 1px solid transparent;
}

.ck-alert--success {
    background: var(--ck-discount-bg);
    border-color: var(--ck-accent);
    color: var(--ck-discount-text);
}

.ck-alert--error {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

/* ──────────────────────────────────────────────────────────────────────────
   RESPONSIVO
   ────────────────────────────────────────────────────────────────────────── */
@media (max-width: 520px) {
    .ck-container {
        padding: 16px 10px 24px;
    }

    .ck-form-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .ck-summary {
        padding: 14px 16px 10px;
    }

    .ck-form-area {
        padding: 14px 16px 18px;
    }

    .ck-divider {
        margin: 0 16px;
    }

    .ck-summary__product {
        flex-wrap: wrap;
    }

    .ck-summary__price {
        width: 100%;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-top: 4px;
        padding-left: 52px;
    }

    .ck-coupon-form {
        flex-direction: column;
    }

    .ck-trust-row {
        gap: 10px;
    }
}

@media (max-width: 360px) {
    .ck-btn-submit {
        font-size: 0.88rem;
        padding: 13px 16px;
    }

    .ck-trust-row span {
        font-size: 0.62rem;
    }
}
