/* ==========================================================================
   Purchase / Checkout Page — ck-* namespace
   ========================================================================== */

/* ==========================================================================
   Section wrapper
   ========================================================================== */
.ck-section {
    background: white;
    padding: 2.5rem 0 4rem;
    min-height: calc(100vh - 80px);
}

/* ==========================================================================
   Page header
   ========================================================================== */
.ck-page-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.ck-page-header__desc {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
    color: #64748b;
    margin: 0.2rem 0 0;
    line-height: 1.6;
}

.ck-page-header__back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    text-decoration: none;
    padding: 0.4rem 0.85rem;
    border-radius: 8px;
    background: white;
    border: 1px solid rgba(44, 61, 133, 0.12);
    transition: all 0.2s ease;
    white-space: nowrap;
}

.ck-page-header__back:hover {
    color: #2C3D85;
    border-color: rgba(44, 61, 133, 0.3);
    background: #f0f4ff;
}

.ck-page-header__back i {
    font-size: 0.7rem;
}

.ck-page-header__title {
    font-family: 'Poppins', sans-serif;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 800;
    color: #2C3D85;
    margin: 0;
}

/* ==========================================================================
   Two-column layout
   ========================================================================== */
.ck-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 1.75rem;
    align-items: start;
}

/* ==========================================================================
   Form card
   ========================================================================== */
.ck-card {
    background: white;
    border-radius: 20px;
    border: 1px solid rgba(44, 61, 133, 0.09);
    box-shadow: 0 4px 24px rgba(44, 61, 133, 0.07);
    overflow: hidden;
}

.ck-card__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
    background: linear-gradient(to right, #f8faff, white);
}

.ck-card__header-icon {
    width: 48px;
    min-width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #2C3D85 0%, #3a4ea0 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    box-shadow: 0 4px 12px rgba(44, 61, 133, 0.25);
    flex-shrink: 0;
}

.ck-card__title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: #2C3D85;
    margin: 0 0 0.15rem;
}

.ck-card__subtitle {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
}

/* ==========================================================================
   Form fields
   ========================================================================== */
.ck-form {
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.ck-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.ck-field {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.ck-field__label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: #2C3D85;
}

.ck-field__wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.ck-field__icon {
    position: absolute;
    left: 0.85rem;
    font-size: 0.82rem;
    color: #94a3b8;
    pointer-events: none;
    transition: color 0.2s ease;
    z-index: 1;
}

.ck-field__wrap:focus-within .ck-field__icon {
    color: #2C3D85;
}

.ck-field__input {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.9rem;
    color: #1a2b4a;
    background: #f8faff;
    border: 1.5px solid rgba(44, 61, 133, 0.15);
    border-radius: 10px;
    padding: 0.65rem 0.9rem 0.65rem 2.4rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    box-sizing: border-box;
    appearance: none;
}

.ck-field__input::placeholder {
    color: #b0bec5;
}

.ck-field__input:focus {
    border-color: #2C3D85;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 61, 133, 0.1);
}

/* Select specific */
.ck-field__wrap--select .ck-field__select-arrow {
    position: absolute;
    right: 0.85rem;
    font-size: 0.72rem;
    color: #94a3b8;
    pointer-events: none;
    z-index: 1;
}

.ck-field__input--select {
    cursor: pointer;
    padding-right: 2.2rem;
}


/* ==========================================================================
   Summary card
   ========================================================================== */
.ck-summary-col {
    position: sticky;
    top: 1.5rem;
}

.ck-summary {
    background: white;
    border-radius: 20px;
    border: 1px solid rgba(44, 61, 133, 0.09);
    box-shadow: 0 4px 24px rgba(44, 61, 133, 0.07);
    overflow: hidden;
}

.ck-summary__header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.4rem 1.75rem;
    background: linear-gradient(135deg, #2C3D85 0%, #3a4ea0 100%);
    color: white;
}

.ck-summary__header i {
    font-size: 1.1rem;
    opacity: 0.9;
}

.ck-summary__title {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: white;
    margin: 0;
}

/* Plan info */
.ck-summary__plan {
    padding: 1.25rem 1.75rem 1rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

/* When plan section contains the recharge dropdown, expand to full width */
.ck-summary__plan .ck-field {
    width: 100%;
    margin: 0;
}

.ck-summary__plan-badge {
    font-family: 'Poppins', sans-serif;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #2C3D85;
    background: rgba(44, 61, 133, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    white-space: nowrap;
}

.ck-summary__plan-name {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: #1a2b4a;
    margin: 0;
}

/* Price breakdown */
.ck-summary__breakdown {
    padding: 1rem 1.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
}

.ck-summary__row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.ck-summary__row-label {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: #64748b;
}

.ck-summary__row-value {
    font-family: 'Poppins', sans-serif;
    font-size: 0.85rem;
    font-weight: 600;
    color: #1a2b4a;
}

.ck-summary__row-value--discount {
    color: #9BB643;
}

/* Total row */
.ck-summary__total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.75rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
}

.ck-summary__total-label {
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: #2C3D85;
}

.ck-summary__total-value {
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: #2C3D85;
}

/* ==========================================================================
   Promo code
   ========================================================================== */
.ck-promo-panel {
    padding: 1rem 1.75rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
}

.ck-promo {
    display: flex;
    gap: 0.5rem;
}

.ck-promo__input-wrap {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
}

.ck-promo__icon {
    position: absolute;
    left: 0.75rem;
    font-size: 0.8rem;
    color: #94a3b8;
    pointer-events: none;
}

.ck-promo__input {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.83rem;
    color: #1a2b4a;
    background: #f8faff;
    border: 1.5px solid rgba(44, 61, 133, 0.15);
    border-radius: 8px;
    padding: 0.55rem 0.75rem 0.55rem 2.1rem;
    width: 100%;
    outline: none;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.ck-promo__input::placeholder {
    color: #b0bec5;
}

.ck-promo__input:focus {
    border-color: #2C3D85;
    box-shadow: 0 0 0 3px rgba(44, 61, 133, 0.08);
}

.ck-promo__input--error {
    border-color: #dc3545;
}

.ck-promo__input--error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.ck-promo__btn {
    font-family: 'Poppins', sans-serif;
    font-size: 0.78rem;
    font-weight: 700;
    color: white;
    background: #2C3D85;
    border: none;
    border-radius: 8px;
    padding: 0 1rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}

.ck-promo__btn:hover {
    background: #9BB643;
}

/* ==========================================================================
   reCAPTCHA placeholder
   ========================================================================== */
.ck-captcha {
    padding: 1rem 1.75rem;
    border-bottom: 1px solid rgba(44, 61, 133, 0.08);
}

.ck-captcha__box {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #f8faff;
    border: 1.5px solid rgba(44, 61, 133, 0.12);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}

.ck-captcha__check {
    width: 20px;
    height: 20px;
    accent-color: #2C3D85;
    cursor: pointer;
    flex-shrink: 0;
}

.ck-captcha__label {
    font-family: 'Open Sans', sans-serif;
    font-size: 0.85rem;
    color: #4a5568;
    flex: 1;
    cursor: pointer;
    margin: 0;
}

.ck-captcha__logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.15rem;
    margin-left: auto;
}

.ck-captcha__logo i {
    font-size: 1.4rem;
    color: #2C3D85;
    opacity: 0.5;
}

.ck-captcha__logo span {
    font-size: 0.6rem;
    color: #94a3b8;
    font-family: 'Poppins', sans-serif;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

/* ==========================================================================
   Buy button
   ========================================================================== */
.ck-buy-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: calc(100% - 3.5rem);
    margin: 1.25rem 1.75rem 2rem;
    background: #9BB643;
    color: white;
    font-family: 'Poppins', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.9rem 1.5rem;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.2s ease, box-shadow 0.25s ease;
    box-shadow: 0 4px 16px rgba(155, 182, 67, 0.38);
}

.ck-buy-btn:hover {
    background: #8aa63a;
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(155, 182, 67, 0.48);
}

.ck-summary__secure-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    color: #94a3b8;
    margin: 0;
    padding: 0 1.75rem 1.5rem;
}

.ck-summary__secure-note i {
    color: #9BB643;
    font-size: 0.8rem;
}

/* ==========================================================================
   Validation states (Bootstrap is-valid / is-invalid on ck-field__input)
   ========================================================================== */
.ck-validation-summary {
    margin-bottom: 1rem;
    padding: 0.9rem 1rem;
    border: 1px solid rgba(220, 53, 69, 0.22);
    border-radius: 14px;
    background: rgba(220, 53, 69, 0.06);
    color: #b42318;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.875rem;
}

.ck-validation-summary:empty,
.validation-summary-valid {
    display: none;
}

.ck-validation-summary ul {
    margin: 0;
    padding-left: 1.1rem;
}

.input-validation-error {
    border-color: #dc3545;
}

.input-validation-error:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.field-validation-valid {
    display: none;
}

.ck-field__input.is-invalid {
    border-color: #dc3545;
}

.ck-field__input.is-invalid:focus {
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.15);
}

.ck-field__input.is-valid {
    border-color: #9BB643;
}

.ck-field__input.is-valid:focus {
    box-shadow: 0 0 0 3px rgba(155, 182, 67, 0.15);
}

/* Mensaje de error inline debajo del campo */
.ck-field__error {
    display: block;
    font-family: 'Open Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    color: #dc3545;
    margin-top: 0.25rem;
    padding-left: 0.15rem;
    animation: ck-field-error-in 0.25s ease;
}

.ck-field__error--promo {
    margin-top: 0.45rem;
    padding-left: 0;
}

@keyframes ck-field-error-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1024px) {
    .ck-layout {
        grid-template-columns: 1fr 340px;
    }
}

@media (max-width: 860px) {
    .ck-layout {
        grid-template-columns: 1fr;
    }

    .ck-summary-col {
        position: static;
        /* form-col is first in markup, summary comes after — natural order */
    }
}

@media (max-width: 640px) {
    .ck-section {
        padding: 1.5rem 0 3rem;
    }

    .ck-form {
        padding: 1.25rem;
    }

    .ck-card__header {
        padding: 1.25rem;
    }

    .ck-field-row {
        grid-template-columns: 1fr;
    }
}
