/**
 * Taylr Direct Payment Form Styles
 */

.form-hostedfields {
    width: 100%;
    max-width: 500px;
    margin: 15px 0;
}

.form-group {
    margin: 4px 0 15px 0;
}

.form-group-fields {
    display: flex;
    flex-direction: row;
    gap: 20px;
}

.form-group label {
    display: inline-block;
    max-width: 100%;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group label.error {
    color: #d00;
    margin: 5px 0 0 0;
    font-weight: normal;
    font-style: italic;
    font-size: 14px;
}

.form-control {
    display: block;
    box-sizing: border-box;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.box_loading {
    padding: 10px;
    text-align: center;
    display: none;
}

.box_creditcard .fields {
    display: block;
}

.box_creditcard.has_cards .fields {
    display: none;
}

.box_listcards > div {
    margin-bottom: 10px;
}

.box_listcards > div input {
    margin-right: 5px;
}

.box_creditcard.has_cards {
    display: none;
    padding-left: 23px;
}

.box_ccv {
    display: none;
    padding-left: 23px;
    width: 170px;
}

.box_ccv .form-group {
    margin-bottom: 15px;
}

/* HostedField specific styles */
.hostedfield:disabled {
    cursor: not-allowed;
    background-color: #eee;
    opacity: 1;
}

.hostedfield {
    padding: 8px 10px 10px 10px !important;
    height: auto !important;
}

.hostedfield:valid {
    border-color: #28a745 !important;
    color: #28a745 !important;
}

.hf-user-invalid.hf-invalid:not(.hf-focus) {
    border-color: #d00 !important;
    color: #d00 !important;
}

.hostedfield:readonly {
    color: lightgrey !important;
}

.hostedfield.hf-autofill {
    color: rgb(0, 0, 0) !important;
}

.hostedfield-frame {
    height: 25px !important;
}

/* Error display */
#taylr-error-info {
    margin: 15px 0;
}

#taylr-error-info .woocommerce-error {
    padding: 1em 2em 1em 3.5em;
    margin: 0 0 2em;
    position: relative;
    background-color: #f7f6f7;
    color: #515151;
    border-top: 3px solid var(--woocommerce-error, #b81c23);
    list-style: none outside;
    width: auto;
    word-wrap: break-word;
}

/* Form validation states */
.form-group.has-error .form-control {
    border-color: #d00;
}

.form-group.has-error label {
    color: #d00;
}

/* 3DS Modal styles */
.taylr-3ds-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.taylr-3ds-modal-content {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    position: relative;
}

/* 3DS Loader styles */
.taylr-3ds-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
    min-height: 300px;
}

.taylr-3ds-spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: taylr-spin 1s linear infinite;
    -webkit-animation: taylr-spin 1s linear infinite;
    -moz-animation: taylr-spin 1s linear infinite;
    -o-animation: taylr-spin 1s linear infinite;
    margin: 0 auto 20px;
}

/* 3DS Loader Spinner Animation - Browser Compatibility */
@keyframes taylr-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@-webkit-keyframes taylr-spin {
    0% { -webkit-transform: rotate(0deg); }
    100% { -webkit-transform: rotate(360deg); }
}

@-moz-keyframes taylr-spin {
    0% { -moz-transform: rotate(0deg); }
    100% { -moz-transform: rotate(360deg); }
}

@-o-keyframes taylr-spin {
    0% { -o-transform: rotate(0deg); }
    100% { -o-transform: rotate(360deg); }
}

.taylr-3ds-loader p {
    margin: 0;
    color: #333;
    font-size: 16px;
    font-weight: 500;
}

.taylr-3ds-loader p:last-child {
    margin-top: 10px;
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

/* 3DS iframe styles */
.taylr-3ds-iframe {
    width: 100%;
    height: 500px;
    border: none;
}

#taylr-3ds-iframe {
    width: 100%;
    min-height: 500px;
    max-height: 80vh;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    background-color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .form-group-fields {
        flex-direction: column;
        gap: 0;
    }
    
    .form-hostedfields {
        max-width: 100%;
    }
}

