/**
 * Payment Gateway Styles
 * Adapted from WordPress plugin for standalone use
 */

/* Reset and base styles */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    margin: 0;
    padding: 20px;
}

/* Override for main site header/footer containers */
.header .container,
.footer .container {
    max-width: var(--max-width, 1280px) !important;
    background: transparent !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    overflow: visible !important;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Ensure payment container doesn't affect header/footer */
.payment-container .container {
    max-width: 800px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.payment-wrapper {
    padding: 30px;
}

/* Form styles */
.form_tpv {
    margin-bottom: 2rem;
}

.plugin-form-tpv h2 {
    text-align: center;
    color: var(--gray-900, #0f172a);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
}

.table-form-tpv {
    width: 100%;
    display: block;
    margin-bottom: 2rem;
    transition: all ease 0.5s;
}

.table-form-tpv.loading {
    opacity: 0.5;
    pointer-events: none;
}

.tpv-plugin-codigo-pedido,
.tpv-plugin-desc-pedido,
.tpv-plugin-cantidad-pagar {
    margin-bottom: 2rem;
    position: relative;
}

.tpv-plugin-codigo-pedido > div:first-child,
.tpv-plugin-desc-pedido > div:first-child,
.tpv-plugin-cantidad-pagar > div:first-child {
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-900, #0f172a);
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
}

.required {
    color: #e74c3c;
    font-weight: bold;
}

/* Input styles */
input#amountTPV,
input#orderNumber,
input#orderDesc,
input#razor_social {
    width: 100%;
    font-size: 1rem;
    border: 2px solid var(--gray-200, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--gray-50, #f8fafc);
    transition: all 0.3s ease;
    outline: none;
    font-family: 'Inter', sans-serif;
    color: var(--gray-800, #1e293b);
}

input#amountTPV {
    font-size: 1.25rem;
    text-align: right;
    font-weight: 600;
}

input#amountTPV:hover,
input#orderNumber:hover,
input#orderDesc:hover,
input#razor_social:hover {
    border-color: var(--gray-300, #cbd5e1);
}

input#amountTPV:focus,
input#orderNumber:focus,
input#orderDesc:focus,
input#razor_social:focus {
    border-color: var(--primary, #6366f1);
    background: white;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

input#amountTPV.warning,
input#orderNumber.warning,
input#orderDesc.warning,
input#razor_social.warning {
    border-color: #e74c3c;
    background-color: rgba(231, 76, 60, 0.1);
}

input#amountTPV::placeholder,
input#orderNumber::placeholder,
input#orderDesc::placeholder,
input#razor_social::placeholder {
    color: var(--gray-400, #94a3b8);
}

input#amountTPV + span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--accent, #22c55e);
    margin-left: 0.5rem;
}

/* Checkbox styles */
input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300, #cbd5e1);
    border-radius: 4px;
    position: relative;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    flex-shrink: 0;
    margin-right: 0.75rem;
    margin-top: 2px;
}

input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #6c5ce7 0%, #a55eea 50%, #3B3B98 100%);
    border-color: #6c5ce7;
}

input[type="checkbox"]:checked::after {
    content: '✓';
    color: white;
    position: absolute;
    top: 45%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    font-weight: bold;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

input[type="checkbox"]:hover {
    border-color: #6c5ce7;
}

label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    line-height: 1.5;
    font-size: 0.875rem;
    color: var(--gray-700, #334155);
    font-family: 'Inter', sans-serif;
}

label a {
    color: var(--primary, #6366f1);
    text-decoration: none;
    transition: color 0.2s;
}

label a:hover {
    color: var(--primary-dark, #4f46e5);
    text-decoration: underline;
}

/* Error messages */
.error {
    color: #e74c3c;
    font-size: 0.9em;
    display: none;
    margin-bottom: 5px;
    font-weight: 500;
}

.error.show {
    display: block;
}

/* Right section */
.section-right-form-tpv {
    text-align: center;
    margin-top: 30px;
    padding-top: 30px;
    border-top: 1px solid #ecf0f1;
}

.img-formaspago {
    margin-bottom: 30px;
}

.img-formaspago img {
    max-width: 300px;
    width: 100%;
    height: auto;
}

/* Payment button */
a#form_tpv_submit {
    display: inline-block;
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    padding: 15px 40px;
    font-size: 1.3em;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    position: relative;
    overflow: hidden;
}

a#form_tpv_submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

a#form_tpv_submit:active {
    transform: translateY(0);
}

a#form_tpv_submit:before {
    content: '';
    width: 24px;
    height: 24px;
    background-image: url('data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZD0iTTIgMTJIMjJNMTYgNkwyMiAxMkwxNiAxOCIgc3Ryb2tlPSJ3aGl0ZSIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiLz4KPC9zdmc+');
    background-size: contain;
    display: inline-block;
    vertical-align: middle;
    margin-right: 12px;
}

/* Payment result styles */
.payment-result {
    text-align: center;
    padding: 40px 20px;
    border-radius: 8px;
    margin: 20px 0;
}

.payment-result.success {
    background: linear-gradient(135deg, #27ae60, #2ecc71);
    color: white;
}

.payment-result.error {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
}

.payment-result h2 {
    margin-bottom: 20px;
    font-size: 1.8em;
    font-weight: 300;
}

.payment-details {
    max-width: 400px;
    margin: 0 auto;
    text-align: left;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row .label {
    font-weight: 500;
}

.detail-row .value {
    font-weight: 600;
}

/* Loading animation */
.table-form-tpv.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 0;
    }
    
    .payment-wrapper {
        padding: 20px;
    }
    
    .plugin-form-tpv h2 {
        font-size: 1.5em;
    }
    
    input#amountTPV,
    input#orderNumber,
    input#orderDesc,
    input#razor_social {
        font-size: 1.1em;
    }
    
    input#amountTPV {
        font-size: 1.3em;
    }
    
    a#form_tpv_submit {
        padding: 12px 30px;
        font-size: 1.1em;
    }
    
    .img-formaspago img {
        max-width: 250px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 10px;
    }
    
    .payment-wrapper {
        padding: 15px;
    }
    
    .plugin-form-tpv h2 {
        font-size: 1.3em;
        margin-bottom: 20px;
    }
    
    .tpv-plugin-codigo-pedido,
    .tpv-plugin-desc-pedido,
    .tpv-plugin-cantidad-pagar {
        margin-bottom: 20px;
    }
    
    a#form_tpv_submit {
        padding: 10px 25px;
        font-size: 1em;
    }
    
    .payment-result {
        padding: 30px 15px;
    }
    
    .payment-result h2 {
        font-size: 1.5em;
    }
}
