* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-blue: #0066FF;
    --primary-blue-dark: #0052CC;
    --bg-white: #FFFFFF;
    --bg-light: #F5F5F5;
    --bg-grey: #F5F5F5;
    --text-dark: #000000;
    --text-gray: #666666;
    --text-light: #999999;
    --border: #E0E0E0;
    --success: #10B981;
    --error: #EF4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg-grey);
    min-height: 100vh;
    padding: 1rem;
}

.payment-page {
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.payment-container {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
}

.payment-header-top {
    text-align: center;
    margin-bottom: 1.5rem;
}

.seller-name-header {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.powered-by {
    font-size: 0.75rem;
    color: var(--text-gray);
    text-transform: none;
}

.payment-summary {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: center;
}

.amount-display-large {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 0.25rem;
    margin-bottom: 0.5rem;
}

.currency-symbol-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.amount-value-large {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-dark);
    line-height: 1;
}

.description-display {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 400;
}

.payment-card {
    background: var(--bg-white);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
}

.payment-header-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.payment-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0;
}

.security-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    color: var(--text-dark);
}

.security-icon svg {
    width: 100%;
    height: 100%;
}

.payment-info {
    width: 100%;
}

.spinner {
    border: 4px solid var(--bg-light);
    border-top: 4px solid var(--primary-blue);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

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

.card-payment-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-field label {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-dark);
}

.form-field input {
    padding: 0.875rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    background: var(--bg-white);
    color: var(--text-dark);
    transition: border-color 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.form-field input:focus {
    outline: none;
    border-color: var(--primary-blue);
}

.form-field input.error {
    border-color: var(--error);
    outline: none;
}

.form-field input::placeholder {
    color: var(--text-light);
}

.card-error-message,
.expiry-error-message {
    font-size: 0.75rem;
    color: var(--error);
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.info-icon {
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.field-help {
    font-size: 0.75rem;
    color: var(--text-gray);
    margin-top: -0.25rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    width: 100%;
}

.form-row .form-field {
    width: 100%;
    min-width: 0;
}


.btn-pay {
    width: 100%;
    padding: 1rem 2rem;
    background: var(--primary-blue);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, opacity 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-pay:hover:not(:disabled) {
    background: var(--primary-blue-dark);
}

.btn-pay:disabled {
    background: var(--text-light);
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-pay.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.btn-pay.loading > * {
    filter: blur(2px);
    pointer-events: none;
}

.btn-pay.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    transform: translate(-50%, -50%);
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin-centered 0.8s linear infinite;
    filter: none;
    z-index: 10;
    pointer-events: none;
}

@keyframes spin-centered {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.privacy-notice {
    font-size: 0.75rem;
    color: var(--text-light);
    text-align: center;
    margin-top: -1.2rem;
    margin-bottom: 0;
}

.privacy-link {
    color: var(--text-light);
    text-decoration: underline;
    cursor: pointer;
}

.privacy-link:hover {
    color: var(--text-gray);
}

.success-message {
    text-align: center;
    padding: 2rem 0;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin: 0 auto 1.5rem;
    font-weight: 700;
    text-transform: uppercase;
}

.success-message h2 {
    font-size: 1.75rem;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.success-message p {
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

.success-note {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-top: 1rem;
}

.error-message {
    text-align: center;
    padding: 2rem 0;
}

.error-message h2 {
    font-size: 1.5rem;
    color: var(--error);
    margin-bottom: 0.5rem;
}

.error-message p {
    color: var(--text-gray);
}

@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }
    
    .payment-page {
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    
    .payment-summary {
        padding: 1.5rem;
    }
    
    .currency-symbol-large,
    .amount-value-large {
        font-size: 2rem;
    }
    
    .payment-card {
        padding: 1.5rem;
    }
    
    .payment-title {
        font-size: 1rem;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .btn-pay {
        font-size: 1rem;
        padding: 0.875rem 1.5rem;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }
    
    .payment-page {
        padding-top: 0.5rem;
        padding-bottom: 0.5rem;
    }
    
    .payment-summary {
        padding: 1rem;
    }
    
    .currency-symbol-large,
    .amount-value-large {
        font-size: 1.75rem;
    }
    
    .description-display {
        font-size: 0.9rem;
    }
    
    .payment-card {
        padding: 1rem;
    }
    
    .seller-name-header {
        font-size: 1rem;
    }
    
    .powered-by {
        font-size: 0.7rem;
    }
    
    .form-field input {
        padding: 0.75rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-pay {
        font-size: 0.95rem;
        padding: 0.875rem 1rem;
    }
    
    .privacy-notice {
        font-size: 0.7rem;
    }
}
