﻿*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    background: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 13px;
    color: #111111;
}

/* ── Outer shell ──────────────────────────────────────────────────── */

.cv3-form {
    padding: 14px 14px 10px;
    width: 100%;
}

/* ── Floating-label field wrapper ─────────────────────────────────── */

.cv3-field {
    position: relative;
    margin-bottom: 14px;
}

/* Row layout — used for expiry+CVV and (optionally) street+postal */
.cv3-row {
    display: flex;
    gap: 10px;
    margin-bottom: 14px;
}

    .cv3-row .cv3-field {
        margin-bottom: 0;
    }

    /* Street 66% / postal 34% inside a cv3-row */
    .cv3-row .cv3-field-street {
        flex: 0 0 66%;
        width: 66%;
    }

    .cv3-row .cv3-field-postal {
        flex: 0 0 calc(34% - 10px);
        width: calc(34% - 10px);
    }

    /* Expiry / CVV split 50/50 */
    .cv3-row .cv3-field-expiry,
    .cv3-row .cv3-field-cvv {
        flex: 1 1 0;
    }

/* ── Label (floating) ─────────────────────────────────────────────── */

.cv3-label-wrap {
    position: relative;
}

    .cv3-label-wrap label {
        position: absolute;
        left: 12px;
        top: 50%;
        transform: translateY(-50%);
        font-size: 13px;
        color: #6b7280;
        pointer-events: none;
        transition: top 0.16s ease, transform 0.16s ease, font-size 0.16s ease, color 0.16s ease;
        background: transparent;
        padding: 0 3px;
        transform-origin: left center;
        white-space: nowrap;
        z-index: 1;
    }

    /* Floated state — value present or focused */
    .cv3-label-wrap.cv3-lw-active label,
    .cv3-label-wrap:focus-within label {
        top: 0;
        transform: translateY(-50%) scale(0.80);
        color: #2E75B6;
        background: #ffffff;
    }

    .cv3-label-wrap.cv3-lw-error label {
        color: #c0392b;
    }

    .cv3-label-wrap.cv3-lw-valid label {
        color: #27ae60;
    }

/* ── Input ────────────────────────────────────────────────────────── */

.cv3-input {
    width: 100%;
    height: 44px;
    padding: 8px 40px 8px 12px; /* top padding floats label clear */
    border: 1.5px solid #d1d5db;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #111111;
    background: transparent;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    -webkit-appearance: none;
    appearance: none;
}

/* Extra right padding when there is a brand icon + indicator (PAN field) */
.cv3-pan-wrap .cv3-input {
    padding-right: 72px; /* 32px icon + 16px ind + gaps */
}

/* Extra right padding when there is only an indicator (single-icon fields) */
.cv3-input-single-icon {
    padding-right: 36px;
}

.cv3-input:focus {
    border-color: #2E75B6;
    box-shadow: 0 0 0 3px rgba(46,117,182,0.12);
}

.cv3-input.cv3-err {
    border-color: #c0392b;
    box-shadow: 0 0 0 3px rgba(192,57,43,0.10);
}

.cv3-input.cv3-ok {
    border-color: #27ae60;
    box-shadow: 0 0 0 3px rgba(39,174,96,0.10);
}

/* Autofill override — keep background transparent */
.cv3-input:-webkit-autofill,
.cv3-input:-webkit-autofill:hover,
.cv3-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px transparent inset;
    box-shadow: 0 0 0 1000px transparent inset;
    transition: background-color 5000s ease-in-out 0s;
    -webkit-text-fill-color: #111111;
}

/* Cardholder — uppercase */
#cardholder {
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Postal — uppercase */
#postal {
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ── Icon slot (right side of input) ─────────────────────────────── */

.cv3-icon-slot {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 5px;
    pointer-events: none;
}

/* ── Validation indicator (green ✓ / red ✗ circle) ───────────────── */
/* Matches the cv-indicator pattern used in Hosted.aspx / Hosted2.aspx */

.cv3-ind {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 9px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1;
    pointer-events: none;
    flex-shrink: 0;
}

    .cv3-ind.cv3-ind-valid {
        display: flex;
        background: #27ae60;
    }

    .cv3-ind.cv3-ind-error {
        display: flex;
        background: #c0392b;
    }

/* ── Brand icon (PAN field) ───────────────────────────────────────── */

.cv3-pan-wrap {
    position: relative;
}

.cv3-brand-icon {
    width: 32px;
    height: 20px;
    object-fit: contain;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── CVV card diagram icon ────────────────────────────────────────── */

.cv3-cvv-icon {
    width: 28px;
    height: 18px;
    pointer-events: none;
    flex-shrink: 0;
}

/* ── Inline field error ───────────────────────────────────────────── */

.cv3-field-error {
    font-size: 11px;
    color: #c0392b;
    margin-top: 3px;
    display: none;
    padding-left: 2px;
}

    .cv3-field-error.cv3-show {
        display: block;
    }

/* ── Required asterisk ───────────────────────────────────────────── */

.cv3-req {
    color: #c0392b;
    margin-left: 2px;
}

/* ── Divider ─────────────────────────────────────────────────────── */

.cv3-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 2px 0 14px;
}

/* ── Recurring checkbox row ───────────────────────────────────────── */

.cv3-recurring {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #e5e7eb;
    cursor: pointer;
    transition: border-color 0.15s;
    margin-bottom: 14px;
}

    .cv3-recurring:hover {
        border-color: #2E75B6;
    }

    .cv3-recurring input[type="checkbox"] {
        width: 15px;
        height: 15px;
        margin: 0;
        cursor: pointer;
        accent-color: #2E75B6;
        flex-shrink: 0;
    }

    .cv3-recurring label {
        font-size: 12px;
        color: #374151;
        cursor: pointer;
        margin: 0;
    }

/* ── Message panel (inline status / error) ────────────────────────── */

#messagePanel {
    display: none;
    padding: 10px 12px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 12px;
    line-height: 1.4;
}

    #messagePanel.cv3-hard-error {
        background: #fdecea;
        border-left: 4px solid #f44336;
        color: #7b1414;
    }

#cvMessage {
    display: none;
    padding: 8px 10px;
    border-radius: 6px;
    font-size: 12px;
    margin-bottom: 10px;
    line-height: 1.4;
}

    #cvMessage.cv-msg-error {
        background: #fdecea;
        border-left: 3px solid #f44336;
        color: #7b1414;
    }

    #cvMessage.cv-msg-decline {
        background: #fff3cd;
        border-left: 3px solid #ffc107;
        color: #7a5a00;
    }

    #cvMessage.cv-msg-info {
        background: #e8f5e9;
        border-left: 3px solid #4caf50;
        color: #1b5e20;
    }

/* ── PCI badge ────────────────────────────────────────────────────── */

.cv3-pci-badge {
    text-align: center;
    margin-top: 10px;
    font-size: 10px;
    color: #aaaaaa;
    letter-spacing: 0.03em;
}

    .cv3-pci-badge svg {
        vertical-align: middle;
        margin-right: 3px;
    }
