* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    padding: 40px 20px;
    color: #333;
}

.container {
    max-width: 750px;
    margin: 0 auto;
    background: #fff;
    padding: 40px 50px;
    border-radius: 8px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

h1 {
    text-align: center;
    font-size: 32px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 25px;
}

.divider {
    height: 3px;
    background: linear-gradient(to right, #3498db, #2c3e50);
    margin-bottom: 40px;
    border-radius: 2px;
}

.form-section {
    margin-bottom: 30px;
}

.section-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
}

.row {
    display: flex;
    gap: 20px;
}

.field {
    flex: 1;
    margin-bottom: 15px;
}

.field.full-width {
    width: 100%;
}

.field input,
.field select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
}

.field input:focus,
.field select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.field select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
}

.field-label {
    display: block;
    font-size: 12px;
    color: #7f8c8d;
    margin-top: 6px;
}

/* Amount Section */
.amount-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.amount-input {
    width: 100%;
    padding: 12px 15px;
    padding-right: 60px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    font-family: inherit;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.amount-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.currency {
    position: absolute;
    right: 15px;
    font-size: 14px;
    font-weight: 500;
    color: #2c3e50;
}

/* Payment Methods */
.payment-methods {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.payment-option input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #3498db;
}

.card-icons {
    display: flex;
    gap: 5px;
}

.card-icons img,
.card-icon {
    height: 32px;
    width: auto;
    border-radius: 4px;
}

.paypal-option {
    flex-direction: column;
    align-items: flex-end;
}

.paypal-option input[type="radio"] {
    position: absolute;
    margin-right: 70px;
}

.paypal-logo {
    height: 28px;
    width: auto;
}

.paypal-link {
    font-size: 12px;
    color: #3498db;
    text-decoration: none;
    margin-top: 5px;
}

.paypal-link:hover {
    text-decoration: underline;
}

/* Submit Button */
.submit-section {
    text-align: center;
    margin-top: 40px;
}

.pay-button {
    background: #2ecc71;
    color: #fff;
    border: none;
    padding: 15px 60px;
    font-size: 18px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.pay-button:hover {
    background: #27ae60;
    transform: translateY(-2px);
}

.pay-button:active {
    transform: translateY(0);
}

/* Card number formatting visual */
#card_number {
    letter-spacing: 1px;
}

/* Responsive Design */
@media (max-width: 600px) {
    .container {
        padding: 30px 25px;
    }

    h1 {
        font-size: 24px;
    }

    .row {
        flex-direction: column;
        gap: 0;
    }

    .payment-methods {
        flex-direction: column;
        align-items: flex-start;
    }

    .paypal-option {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .paypal-option input[type="radio"] {
        position: static;
        margin-right: 10px;
    }

    .pay-button {
        width: 100%;
        padding: 15px 30px;
    }
}

/* Error state for validation */
.field input.error,
.field select.error {
    border-color: #e74c3c;
    background-color: #fdf2f2;
}

.field input.error:focus,
.field select.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
    background-color: #fff;
}

/* Error message */
.error-message {
    color: #e74c3c;
    font-size: 11px;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.error-message::before {
    content: "⚠";
    font-size: 12px;
}

/* Shake animation for errors */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    10%, 30%, 50%, 70%, 90% { transform: translateX(-4px); }
    20%, 40%, 60%, 80% { transform: translateX(4px); }
}

.field input.error,
.field select.error {
    animation: shake 0.5s ease-in-out;
}

/* Valid state */
.field input.valid,
.field select.valid {
    border-color: #2ecc71;
    background-color: #f0fff4;
}

/* Disabled button state */
.pay-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
}

.pay-button:disabled:hover {
    background: #95a5a6;
    transform: none;
}

/* Hidden row for city-states */
#city-state-row {
    transition: all 0.3s ease;
}

#city-state-row[style*="display: none"] {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

/* Input placeholders */
input::placeholder {
    color: #aaa;
    font-size: 13px;
}

/* ==================== MODAL WINDOWS ==================== */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background: #fff;
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-icon {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    font-size: 36px;
    font-weight: bold;
}

.success-modal .modal-icon {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
    color: #fff;
}

.error-modal .modal-icon {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
}

.modal-content h3 {
    font-size: 24px;
    margin-bottom: 15px;
    color: #2c3e50;
}

.modal-content p {
    color: #7f8c8d;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 25px;
}

.modal-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: #fff;
    border: none;
    padding: 12px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.modal-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(52, 152, 219, 0.4);
}

.success-modal .modal-button {
    background: linear-gradient(135deg, #2ecc71, #27ae60);
}

.success-modal .modal-button:hover {
    box-shadow: 0 5px 20px rgba(46, 204, 113, 0.4);
}

.error-modal .modal-button {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
}

.error-modal .modal-button:hover {
    box-shadow: 0 5px 20px rgba(231, 76, 60, 0.4);
}

/* Success animation */
@keyframes success-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(46, 204, 113, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(46, 204, 113, 0);
    }
}

.pay-button.success {
    animation: success-pulse 1s ease-out;
}

