#calpay-form .calpay-p-Grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -8px;
}

#calpay-form .calpay-p-GridCell {
    padding: 0 8px;
    box-sizing: border-box;
}

#calpay-form .calpay-p-GridCell--12 {
    width: 100%;
}

@media (min-width: 768px) {
    #calpay-form .calpay-p-GridCell--sm6 {
        width: 50%;
    }
}

#calpay-form .p-Field {
    margin-bottom: 16px;
}

#calpay-form .p-FieldLabel {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    color: #424770;
}

#calpay-form .p-Select, .p-Input {
    position: relative;
}

#calpay-form .calpay-p-Select-select, .calpay-p-Input-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: white;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    padding: 10px 12px;
    width: 100%;
    font-size: 16px;
    color: #32325d;
    box-sizing: border-box;
    transition: background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02);
}

#calpay-form .calpay-p-Select-select:focus, .calpay-p-Input-input:focus {
    outline: none;
    border-color: #80bdff; /* Blue border on focus */
    box-shadow: 0 0 0 3px rgba(0, 123, 255, .25);
}

#calpay-form .p-InputIcon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#calpay-form .p-InputIcon svg {
    width: 0.8em;
    height: 0.8em;
}

#calpay-form :root {
    --colorIconChevronDown: #32325d;
}

/*#calpay-form .u-mt-grid {
    margin-top: 16px;
}
*/
#calpay-form .error-message {
    color: #df1b41; /* Red text for error message */
    font-size: 15px;
    margin-top: 4px;
    display: none; /* Initially hidden */
}
#calpay-form .error-message.visible {
    display: block; /* Show error messages when visible */
}

#calpay-form input.error {
    color: red; /* Turns input text red */
    border-color: #df1b41; /* Red border */
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02), 0 0 0 1px #df1b41;
}


/* CSS to hide the ZIP code field */
.visibility-none {
    visibility: hidden;
    max-height: 1px !important;
}

#calpay-form .hidden {
    display: none;
}

/* CSS to make the country field full width */
#calpay-form .full-width {
    width: 100%;
}

#calpay-form .calpay-form-row {
    margin-bottom: 16px;
}

#calpay-form .calpay-form-row-inline {
    display: block;
    /*    justify-content: space-between;*/
}

#calpay-form .col-50 {
/*    width: 50%;*/
    display: inline-block;
}

#calpay-form .col-50-left {
    margin-right: 7px;
}

#calpay-form .col-50-right {
    margin-left: 7px;
}

#calpay-form label {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 8px;
    color: #424770;
}

#calpay-form .input-container {
    position: relative;
}

#calpay-form input {
    background-color: white;
    border: 1px solid #e4e4e4;
    border-radius: 4px;
    padding: 10px 12px;
    width: 100%;
    font-size: 16px;
    color: #32325d;
    box-sizing: border-box;
    transition: background 0.15s ease, border 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02);
}

#calpay-form input:focus {
    outline: none !important;
    border-color: #80bdff !important;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, .25) !important;
}

#calpay-form input::placeholder {
    color: #aab7c4;
}

#calpay-form input.error {
    color: red;
    border-color: #df1b41;
    box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.03), 0px 3px 6px rgba(0, 0, 0, 0.02), 0 0 0 1px #df1b41;
}

#calpay-form .calpay-card-brand-icon {
    vertical-align: middle;
}
#calpay-form .calpay-card-brand-icons {
    position: absolute;
    right: 5px;
    transform: translateY(-50%);
    top: 50%;
    right: 10px;
    display: block;
}

#calpay-form .calpay-card-brand-icon {
    width: 24px;
    height: 24px;
    object-fit: contain;
    margin-left: 4px;
    transition: width 0.4s ease-in-out;
    opacity: 1;
}

#calpay-form .calpay-card-brand-icon:not(.active) {
    width: 0;
    opacity: 0;
    position: absolute;
    right: 0;
    transition: width 0.4s ease-in-out;
}

#calpay-form .calpay-card-brand-icon.dynamic {
    transition: opacity 0s;
}

#calpay-form .calpay-card-brand-icon.dynamic:not(.active) {
    opacity: 0;
    width: 24px;
    position: absolute;
    right: 0;
}

#calpay-form .invalid-cvc-icon,
#calpay-form .invalid-card-icon {
    display: none;
    fill: red;
}

#calpay-form .invalid-cvc-icon.active,
#calpay-form .invalid-card-icon.active {
    display: inline-block;
}

#calpay-form .cvc-wrapper {
    position: relative;
}

#calpay-form .cvc-icons {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
}

#calpay-form .cvc-icon {
    width: 24px;
    height: 24px;
    display: none;
}

#calpay-form .cvc-icon.active {
    display: block;
}

#calpay-form #pay-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 12px 16px;
    font-size: 16px;
    font-weight: 600;
    color: white;
    background-color: #635bff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.15s ease;
    overflow: hidden;
    height: 44px;
}

#calpay-form .lock-icon {
    display: none;
}

#calpay-form #pay-button:hover:not(:disabled) {
    background-color: #5851e6;
}

#calpay-form #pay-button:focus:not(:disabled) {
    outline: none;
    box-shadow: 0 0 0 2px rgba(99,91,255,0.2);
}

#calpay-form #pay-button:active:not(:disabled) {
    background-color: #4f47d8;
}

#calpay-form #pay-button:disabled {
    background-color: #e0e0e0; /* Grey background to indicate disabled state */
    color: #a0a0a0; /* Light grey text color */
    cursor: not-allowed;
}
.SubmitButton--disabled {
    background-color: #e0e0e0 !important; /* Same grey background as above */
    color: #a0a0a0 !important; /* Same light grey text color */
}

.SubmitButton--disabled .SubmitButton-IconContainer {
    display: none;
}

#calpay-form .SubmitButton-IconContainer {
    position: absolute;
    right: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
}

#calpay-form .Icon {
    width: 100%;
    height: 100%;
}

#calpay-form .Icon svg {
    width: 100%;
    height: 100%;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

#calpay-form .Icon--loading svg {
    animation: rotate 1s linear infinite;
}

#calpay-form .Icon--loading circle {
    stroke-dasharray: 60;
    stroke-dashoffset: 20;
    stroke-linecap: round;
}

#calpay-form .SubmitButton--success {
    background-color: #24b47e !important;
    transition: background-color 0.3s ease;
}

#calpay-form .SubmitButton--success span {
    display: none;
}

#calpay-form .SubmitButton--success .SubmitButton-IconContainer {
    right: auto;
    left: 50%;
    transform: translateX(-50%);
    width: 28.8px;
    height: 28.8px;
}

#calpay-form .SubmitButton-CheckmarkIcon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#calpay-form .SubmitButton-CheckmarkIcon svg path.checkmark {
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
    animation: checkmark 0.3s ease-in-out forwards;
}

@keyframes checkmark {
    0% {
        stroke-dashoffset: 50;
    }
    100% {
        stroke-dashoffset: 0;
    }
}

#calpay-form .error-message {
    color: #df1b41;
    font-size: 15px;
    margin-top: 4px;
    display: none; /* Initially hidden */
    line-height: 1.3;
    word-wrap: break-word;
}

#calpay-form .input-container {
    position: relative;
    margin-bottom: 5px; /* Increase bottom margin to accommodate error messages */
}

#calpay-form .col-50-1 {
    margin-right: 5px;
}
#calpay-form .col-50-1,
#calpay-form .col-50-2 {
    width: calc(50% - 5px);
}

#calpay-form .col-50-2 {
    margin-left: 5px;
}

/* media queries */
#calpay-form .col-50-Col-1 {
    margin-bottom: 16px;
    width: 100%;
}
#calpay-form .col-50-Col-2 {
    width: 100%;
    margin-left: 0;
}
#calpay-form .calpay-calpay-form-row-1-col,
#calpay-form .calpay-calpay-form-row-2-col {
    width: 50%;
    width: 50%;
    display: inline-block;
    vertical-align: top;
}
#calpay-form .calpay-calpay-form-row-2-col .card-cvc-50 {
    vertical-align: top;
}

#calpay-form .calpay-calpay-form-row-1-col {
    margin-right: 2%;
    width: 48%;
}
#calpay-form .calpay-calpay-form-row-2-col {
    margin-bottom: 0;
    width: 50%;
}
#calpay-form .calpay-calpay-form-row-2-col .col-50 {
    width: 48%;
}
#calpay-form .calpay-calpay-form-row-2-col .col-50-1 {
    margin-left: 0;
    margin-right: 0;
}
#calpay-form .calpay-calpay-form-row-2-col .col-50-2 {
    margin-left: 4%;
    margin-right: 0;
}
/*#calpay-form .calpay-card-brand-icons-1 {
    top: 7px;
}*/

#woocommerce-gateway-calpay-root div.calpay-form-row {
    padding: 0;
}