/* ==========================================================
   GRID LAYOUT
========================================================== */

.cardknox-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

@media (max-width: 768px) {
    .cardknox-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================
   COLUMN RESET (NO BACKGROUNDS)
========================================================== */

.cardknox-col {
    background: none;
    padding: 0;
    border-radius: 0;
}

/* ==========================================================
   SECTION HEADINGS
========================================================== */

.cardknox-col h3 {
    font-size: 21px;
    color: #000;
    margin: 30px 0 20px;
    font-weight: 600;
}

/* ==========================================================
   SECTION DIVIDERS
========================================================== */

.cardknox-col hr {
    margin: 35px 0;
    border: none;
    border-top: 1px solid #e5e5e5;
}

/* ==========================================================
   FORM FIELD LAYOUT
========================================================== */

.ck-field {
    position: relative;
    margin-bottom: 22px;
}

.ck-row {
    display: flex;
    gap: 16px;
    margin-bottom: 22px;
}

.ck-row .ck-field {
    flex: 1;
}

/* ==========================================================
   FLOATING LABELS
========================================================== */

.ck-field label {
    position: absolute;
    top: -9px;
    left: 14px;
    background: #fff;
    padding: 0 6px;
    font-size: 12px;
    font-weight: 500;
    color: #333;
    z-index: 2;
}

.ck-field label span {
    color: #d00;
}

/* ==========================================================
   INPUTS & SELECTS
========================================================== */

.ck-field input,
.ck-field select {
    width: 100%;
    height: 52px;
    padding: 14px;
    border: 1px solid #000;
    border-radius: 14px;
    font-size: 14px;
    background: #fff;
    outline: none;
    box-sizing: border-box;
}

.ck-field input:focus,
.ck-field select:focus {
    border-color: #421D3F;
}

/* ==========================================================
   SELECT DROPDOWN ARROW
========================================================== */

.ck-field select {
    appearance: none;
    background-image: url("data:image/svg+xml;utf8,<svg fill='black' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
}

/* ==========================================================
   CHECKBOX
========================================================== */

.checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

/* ==========================================================
   PAYMENT HEADER + CARD ICONS
========================================================== */

.cardknox-payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.cardknox-card-icons {
    display: flex;
    gap: 8px;
}

.cardknox-card-icons img {
    height: 18px;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.cardknox-card-icons img.active {
    opacity: 1;
}

/* ==========================================================
   SUBMIT BUTTON (FINAL)
========================================================== */

.cardknox-submit {
    width: 100%;
    padding: 16px;
    margin-top: 10px;
    background-color: #421D3F;
    color: #fff;
    border: 1px solid #421D3F;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

.cardknox-submit:hover {
    background-color: #fff;
    color: #421D3F;
    border: 1px solid #421D3F;
}

/* ==========================================================
   SUCCESS & ERROR MESSAGE
========================================================== */

.cardknox-message {
    margin-top: 15px;
    font-size: 14px;
}

.cardknox-message.success {
    color: #1a7f37;
}

.cardknox-message.error {
    color: #c62828;
}

/* ==========================================================
   MOBILE FIXES
========================================================== */

@media (max-width: 768px) {
    .cardknox-col h3 {
        margin-top: 20px;
    }
}

/* ==========================================================
   PAYMENT HEADER (TITLE ONLY)
========================================================== */
#cardknox-donation-form .cardknox-payment-header h3 {
    margin: 0 0 8px !important;   /* small gap under title */
    font-size: 21px !important;
    color: #000 !important;
    font-weight: 600 !important;
}

/* ==========================================================
   CARD ICON ROW (BELOW HEADER)
========================================================== */
#cardknox-donation-form .cardknox-card-icons-wrapper {
    display: flex;
    justify-content: flex-end;   /* RIGHT ALIGN */
    margin-bottom: 8px;          /* 🔥 close to card input */
}

#cardknox-donation-form .cardknox-card-icons {
    display: flex;
    gap: 8px;
}

#cardknox-donation-form .cardknox-card-icons img {
    height: 20px;
    width: auto;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

#cardknox-donation-form .cardknox-card-icons img.active {
    opacity: 1;
}

/* ==========================================================
   REDUCE GAP BEFORE CARD NUMBER
========================================================== */
#cardknox-donation-form #xCardNum {
    margin-top: 4px !important;
}

/* ==================================================
   FORCE EQUAL HEADER HEIGHT FOR BOTH COLUMNS
================================================== */
.cardknox-section-header {
    min-height: 42px;               /* SAME HEIGHT */
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.cardknox-section-header h3 {
    font-size: 21px;
    color: #000;
    font-weight: 600;
    margin: 0;
}

/* ==================================================
   PAYMENT CARD ICON POSITIONING (RIGHT + TIGHT)
================================================== */
.cardknox-card-icons-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;             /* small gap before card input */
}

.cardknox-card-icons {
    display: flex;
    gap: 8px;
}

.cardknox-card-icons img {
    height: 20px;
    opacity: 0.35;
    transition: opacity 0.2s ease;
}

.cardknox-card-icons img.active {
    opacity: 1;
}

/* ==================================================
   REMOVE EXTRA TOP PUSH FROM PAYMENT COLUMN
================================================== */
.cardknox-col {
    display: flex;
    flex-direction: column;
}

.cardknox-col > *:first-child {
    margin-top: 0 !important;
}

/* ==================================================
   FORCE PERFECT HEADER ALIGNMENT
================================================== */

.cardknox-header-row {
    height: 48px;                 /* FIXED HEIGHT */
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}

.cardknox-header-row h3 {
    font-size: 21px;
    color: #000;
    font-weight: 600;
    margin: 0;
}

/* ==================================================
   CARD ICON POSITION (BELOW HEADER, RIGHT)
================================================== */

.cardknox-card-icons-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 6px;           /* small gap before card input */
}

.cardknox-card-icons img {
    height: 20px;
    opacity: 0.35;
}

.cardknox-card-icons img.active {
    opacity: 1;
}

/* ===============================
   CARDKNOX CENTER POPUP
================================ */

.cardknox-popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.cardknox-popup-overlay.show {
    display: flex;
}

.cardknox-popup {
    background: #fff;
    width: 100%;
    max-width: 420px;
    border-radius: 18px;
    padding: 26px 22px 24px;
    text-align: center;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.25);
    animation: ckPopupIn 0.3s ease;
}

/* Close button */
.cardknox-popup-close {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: none;
    font-size: 22px;
    cursor: pointer;
    color: #777;
}

.cardknox-popup-close:hover {
    color: #000;
}

/* Icon */
.cardknox-popup-icon {
    font-size: 42px;
    margin-bottom: 12px;
}

/* Text */
.cardknox-popup-text {
    font-size: 16px;
    font-weight: 500;
    line-height: 1.45;
    color: #333;
}

/* States */
.cardknox-popup.success .cardknox-popup-icon {
    color: #1f7a4d;
}

.cardknox-popup.error .cardknox-popup-icon {
    color: #b42318;
}

/* Animation */
@keyframes ckPopupIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Mobile */
@media (max-width: 480px) {
    .cardknox-popup {
        margin: 0 16px;
    }
}

/* =====================================
   TOTAL PAYMENTS – INLINE SENTENCE STYLE
===================================== */

.ck-total-payments-row {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 2px;
    font-size: 15px;
    color: #000;
}

/* Text parts */
.ck-total-text {
    white-space: nowrap;
}

/* Small number input */
.ck-total-input input {
    width: 64px;               /* 👈 small input */
    height: 40px;
    padding: 6px 8px;
    font-size: 14px;
    text-align: center;
    border: 1px solid #000;
    border-radius: 10px;
}

/* Remove browser number arrows if desired */
.ck-total-input input::-webkit-outer-spin-button,
.ck-total-input input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.ck-total-input input[type=number] {
    -moz-appearance: textfield;
}

/* Visually hidden label (accessibility) */
.ck-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 480px) {
    .ck-total-payments-row {
        flex-wrap: wrap;
        gap: 6px;
    }

    .ck-total-input input {
        width: 56px;
    }
}

.cardknox-submit.processing {
    opacity: 0.7;
    cursor: not-allowed;
}