/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #333333;
    line-height: 1.6;
    min-height: 100vh;
}

.page-background {
    min-height: 100vh;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
}

/* Main Payment Container */
.payment-container {
    background: #ffffff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 700px;
    overflow: hidden;
}

/* Left Panel - Payment Summary Only */
.left-panel {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 30px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    border-right: 1px solid #e2e8f0;
}

.left-panel::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 70%);
    pointer-events: none;
}



/* Payment Summary Card - Full Height */
.payment-summary-card {
    background:
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%) padding-box,
        linear-gradient(90deg, #667eea 0%, #764ba2 50%, #667eea 100%) border-box;
    border-radius: 18px;
    padding: 32px;
    box-shadow: 
        0 12px 28px rgba(0,0,0,0.08),
        0 4px 12px rgba(0,0,0,0.04),
        inset 0 1px 0 rgba(255,255,255,0.8);
    border: 2px solid transparent;
    z-index: 1;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* Fill the entire left panel */
    flex: 1;
    height: 100%;
    backdrop-filter: blur(10px);
}

/* Removed left-footer and support elements per redesign */

/* removed pseudo-element border; using background-clip technique for crisp corners */

.payment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.payment-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #e6fffa;
    color: #234e52;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    border: 1px solid #b2f5ea;
}

.shield-icon {
    width: 14px;
    height: 14px;
}

.amount-container {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    margin: 32px 0;
    gap: 12px;
}

.currency-symbol {
    font-size: 42px;
    font-weight: 700;
    color: #667eea;
    line-height: 1;
    align-self: flex-start;
    margin-top: 8px;
}

.amount-value {
    font-size: 56px;
    font-weight: 800;
    color: #2d3748;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1;
    letter-spacing: -0.5px;
    text-shadow: 0 2px 6px rgba(0,0,0,0.12), 0 1px 0 rgba(255,255,255,0.3);
}

/* Manual Amount Input Styles */
.amount-input-container {
    margin-bottom: 24px;
}

.amount-input-label {
    display: block;
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 12px;
    text-align: center;
}

.amount-input-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 12px 16px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
}

.amount-input-wrapper:focus-within {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.amount-input-wrapper .currency-symbol {
    font-size: 24px;
    font-weight: 600;
    color: #4a5568;
    margin-right: 8px;
}

.amount-input-wrapper input {
    border: none;
    outline: none;
    font-size: 24px;
    font-weight: 600;
    color: #1a202c;
    background: transparent;
    min-width: 120px;
    text-align: left;
}

.amount-input-wrapper input::placeholder {
    color: #a0aec0;
}

.amount-input-hint {
    font-size: 12px;
    color: #718096;
    text-align: center;
    margin-top: 8px;
}

.payment-details {
    border-top: 1px solid #e2e8f0;
    padding-top: 24px;
    margin: 32px 0;
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.detail-row:last-child {
    margin-bottom: 0;
    padding-top: 10px;
    border-top: 1px solid #e2e8f0;
    font-weight: 600;
}

.detail-label {
    font-size: 14px;
    color: #718096;
}

.detail-value {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
}

.security-features {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* When left panel is on top (1024px and below): Display in one row */
@media (max-width: 1024px) {
    .security-features {
        flex-direction: row !important;
        gap: 8px !important;
        justify-content: space-between !important;
    }
}

/* Desktop side-by-side layout (above 1024px): Display in three rows (column layout) */
@media (min-width: 1025px) {
    .security-features {
        flex-direction: column !important;
        gap: 14px !important;
        padding-top: 20px !important;
    }
}

.feature {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 8px 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    font-size: 14px;
    color: #4a5568;
    min-height: auto;
    height: auto;
    flex-wrap: nowrap;
    white-space: nowrap;
    font-weight: 500;
}

/* When left panel is on top (1024px and below): Compact horizontal layout */
@media (max-width: 1024px) {
    .feature {
        flex-direction: column !important;
        justify-content: center !important;
        text-align: center !important;
        gap: 4px !important;
        padding: 6px 4px !important;
        font-size: 12px !important;
        flex: 1 !important;
    }
}

/* Desktop side-by-side layout (above 1024px): Larger vertical layout */
@media (min-width: 1025px) {
    .feature {
        font-size: 16px !important;
        gap: 12px !important;
        padding: 10px 0 !important;
        font-weight: 500 !important;
        color: #4a5568 !important;
        flex-direction: row !important;
        justify-content: flex-start !important;
        text-align: left !important;
    }
}

.feature:last-child {
    margin-bottom: 0;
}

.feature-icon { 
    width: 18px; 
    height: 18px; 
    color: #48bb78; 
    flex-shrink: 0;
}

/* When left panel is on top (1024px and below): Smaller icons */
@media (max-width: 1024px) {
    .feature-icon { 
        width: 16px !important; 
        height: 16px !important; 
    }
}

/* Desktop side-by-side layout (above 1024px): Larger icons */
@media (min-width: 1025px) {
    .feature-icon { 
        width: 20px !important; 
        height: 20px !important; 
    }
}

/* Default: show full text, hide mobile text */
.feature-text-full { display: inline; }
.feature-text-mobile { display: none; }

/* When left panel is on top (1024px and below): hide full text, show mobile text */
@media (max-width: 1024px) {
    .feature-text-full { display: none !important; }
    .feature-text-mobile { display: inline !important; }
}

/* Desktop side-by-side layout (above 1024px): show full text, hide mobile text */
@media (min-width: 1025px) {
    .feature-text-full { display: inline !important; }
    .feature-text-mobile { display: none !important; }
}

/* Custom Country Dropdown */
.custom-country-dropdown {
    position: relative;
    width: 100%;
}

.custom-country-dropdown.active {
    z-index: 1100;
}

.selected-country {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 12px;
}

.selected-country:hover {
    border-color: #cbd5e0;
}

.selected-country:focus,
.selected-country.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.country-flag-container {
    width: 24px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.country-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* SVG sprite-based flags */
.country-flag svg {
    width: 24px;
    height: 18px;
    border-radius: 2px;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.country-name {
    flex: 1;
    font-size: 16px;
    color: #2d3748;
}

.dropdown-arrow {
    width: 20px;
    height: 20px;
    color: #a0aec0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.selected-country.active .dropdown-arrow {
    transform: rotate(180deg);
}

.country-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 280px;
    overflow: hidden;
    z-index: 1100;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    min-width: 300px;
}

/* Dropdown opens upward when near bottom */
.country-dropdown-list.dropdown-up {
    top: auto;
    bottom: 100%;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
}

.country-dropdown-list.active {
    display: block;
}

/* Search Container */
.country-search-container {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.country-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: border-color 0.2s ease;
}

.country-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.country-search-input::placeholder {
    color: #94a3b8;
}

/* Countries Container */
.countries-container {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.countries-container::-webkit-scrollbar {
    width: 6px;
}

.countries-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.countries-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.countries-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.no-results-message {
    padding: 20px 16px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    font-style: italic;
    display: none;
}

.country-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 12px;
    border-bottom: 1px solid #f7fafc;
}

.country-item:hover {
    background-color: #f7fafc;
}

.country-item:last-child {
    border-bottom: none;
}

.country-item .country-flag {
    width: 24px;
    height: 18px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.country-item .country-name {
    flex: 1;
    font-size: 14px;
    color: #2d3748;
}

.country-dial-code {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
    flex-shrink: 0;
}

/* Phone Field with Separate Country Selector */
.phone-field-container {
    display: flex;
    gap: 12px;
    align-items: stretch;
    overflow: visible;
}

.phone-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.phone-country-selector {
    flex: 0 0 140px;
    position: relative;
    z-index: 1000;
    overflow: visible;
}

.phone-field-container input[type="tel"] {
    flex: 1;
    min-width: 0;
}

.phone-input-wrapper input[type="tel"] {
    flex: 1;
    min-width: 0;
}

/* Phone Country Dropdown */
.phone-custom-dropdown {
    position: relative;
    width: 100%;
}

.phone-selected-country {
    display: flex;
    align-items: center;
    padding: 14px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background-color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    gap: 8px;
    height: 54px;
    box-sizing: border-box;
}

.phone-selected-country:hover {
    border-color: #cbd5e0;
}

.phone-selected-country:focus,
.phone-selected-country.active {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.phone-country-flag-container {
    width: 20px;
    height: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.phone-country-flag-container .country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* SVG sprite-based phone flags */
.phone-country-flag-container .country-flag svg {
    width: 20px;
    height: 15px;
    border-radius: 2px;
    display: block;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.phone-dial-code-display {
    font-size: 14px;
    color: #2d3748;
    font-weight: 500;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.phone-dropdown-arrow {
    width: 16px;
    height: 16px;
    color: #a0aec0;
    transition: transform 0.3s ease;
    flex-shrink: 0;
}

.phone-selected-country.active .phone-dropdown-arrow {
    transform: rotate(180deg);
}

.phone-country-dropdown-list {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    border: 2px solid #e2e8f0;
    border-top: none;
    border-radius: 0 0 12px 12px;
    max-height: 280px;
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 1001;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    width: 320px;
    min-width: 320px;
}

/* Phone dropdown opens upward when near bottom */
.phone-country-dropdown-list.dropdown-up {
    top: auto;
    bottom: 100%;
    left: 0;
    border-top: 2px solid #e2e8f0;
    border-bottom: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -10px 25px rgba(0,0,0,0.1);
}

.phone-country-dropdown-list.active {
    display: block;
}

/* Phone Search Container */
.phone-country-search-container {
    padding: 12px 16px;
    border-bottom: 1px solid #f1f5f9;
    background: #f8fafc;
}

.phone-country-search-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    outline: none;
    transition: border-color 0.2s ease;
}

.phone-country-search-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

.phone-country-search-input::placeholder {
    color: #94a3b8;
}

/* Phone Countries Container */
.phone-countries-container {
    max-height: 200px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e0 #f1f5f9;
}

.phone-countries-container::-webkit-scrollbar {
    width: 6px;
}

.phone-countries-container::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.phone-countries-container::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

.phone-countries-container::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

.phone-country-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    gap: 10px;
    border-bottom: 1px solid #f7fafc;
    min-width: 0;
    overflow: hidden;
}

.phone-country-item:hover {
    background-color: #f7fafc;
}

.phone-country-item:last-child {
    border-bottom: none;
}

.phone-country-item .country-flag {
    width: 20px;
    height: 15px;
    object-fit: cover;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    flex-shrink: 0;
}

.phone-country-item .phone-country-name {
    flex: 1;
    font-size: 13px;
    color: #2d3748;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.phone-country-item .country-dial-code {
    font-size: 13px;
    color: #667eea;
    font-weight: 600;
    flex-shrink: 0;
    width: 50px;
    text-align: right;
}

/* Right Panel - Payment Steps */
.right-panel {
    padding: 40px;
    display: flex;
    flex-direction: column;
}

/* Payment Methods */
.payment-methods {
    margin-bottom: 32px;
}

.payment-method {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border: 2px solid #667eea;
    border-radius: 12px;
    background: #f7faff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
    font-weight: 600;
    color: #667eea;
}

.payment-method:hover {
    background: #edf2f7;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.method-icon {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Step Indicator */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.step-indicator::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    height: 2px;
    background: #e2e8f0;
    z-index: 1;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #a0aec0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: #667eea;
    color: white;
}

.step.completed .step-number {
    background: #48bb78;
    color: white;
}

.step-label {
    font-size: 12px;
    color: #718096;
    font-weight: 500;
}

.step.active .step-label {
    color: #667eea;
    font-weight: 600;
}

/* Form Container */
.form-container {
    flex: 1;
}

.step-content {
    display: none;
}

.step-content.active {
    display: block;
}

h3 {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #4a5568;
    font-size: 14px;
}

input, select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 14px;
    transition: all 0.3s ease;
    background-color: #ffffff;
    color: #2d3748;
}

input:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input::placeholder {
    color: #a0aec0;
    font-weight: 500;
}

/* Special styling for cardholder name input */
#cardholderName {
    font-size: 18px;
    font-weight: 600;
    color: #667eea;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Card Input Wrapper */
.card-input-wrapper {
    position: relative;
    margin-bottom: 20px;
}

.card-logo {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 20px;
    border-radius: 4px;
}

.card-logo.mastercard {
    background: linear-gradient(45deg, #eb001b 0%, #ff5f00 50%, #f79e1b 100%);
}

/* Expiry Inputs */
.expiry-inputs {
    display: flex;
    align-items: center;
    gap: 8px;
}

.expiry-inputs select {
    flex: 1;
}

.expiry-inputs span {
    font-size: 18px;
    font-weight: 600;
    color: #4a5568;
}



/* Payment Summary */
.payment-summary {
    background: #f8faff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #4a5568;
}

.summary-row.total {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    padding: 16px 0 0 0;
    border-top: 1px solid #e2e8f0;
    margin-top: 8px;
}

/* Step Actions */
.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn-back, .btn-next, .btn-pay {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn-back {
    background: #f7faff;
    color: #667eea;
    border: 2px solid #e2e8f0;
}

.btn-back:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.btn-next {
    background: #667eea;
    color: white;
}

.btn-next:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-pay {
    background: linear-gradient(135deg, #e53e3e 0%, #c53030 100%);
    color: white;
    font-size: 18px;
    padding: 18px 24px;
}

.btn-pay:hover {
    background: linear-gradient(135deg, #c53030 0%, #9c2626 100%);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(197, 48, 48, 0.3);
}

.btn-pay:active, .btn-next:active, .btn-back:active {
    transform: translateY(0);
}

.btn-pay:disabled, .btn-next:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Primary Button Styles (for Try Again and Retry buttons) */
.btn-primary {
    flex: 1;
    padding: 16px 24px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    background: #667eea;
    color: white;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    min-width: 120px;
}

.btn-primary:hover {
    background: #5a67d8;
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: #cbd5e0;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Responsive styles for primary buttons */
@media (max-width: 768px) {
    .btn-primary {
        width: 100%;
        padding: 14px 20px;
        font-size: 15px;
    }
}

@media (min-width: 769px) {
    .btn-primary {
        padding: 12px 16px;
        font-size: 14px;
        height: 40px;
        min-width: 100px;
    }
}

/* Loading States */
.btn-loading {
    display: none;
}

.btn-pay.loading .btn-text, .btn-next.loading .btn-text {
    display: none;
}

.btn-pay.loading .btn-loading, .btn-next.loading .btn-loading {
    display: inline;
}

/* Security Notice */
.security-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    color: #48bb78;
    font-size: 12px;
    font-weight: 500;
}

.security-icon {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Confirmation Step */
.confirmation-step, .decline-step, .threeds-step, .processing-step {
    display: none;
    text-align: center;
    padding: 40px 20px;
}

.confirmation-content, .decline-content, .threeds-content, .processing-content {
    max-width: 400px;
    margin: 0 auto;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #48bb78;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 30px;
    animation: successPulse 0.6s ease-out;
}

.processing-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 30px;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3742fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.threeds-icon {
    width: 80px;
    height: 80px;
    background: #3742fa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    margin: 0 auto 30px;
    animation: threeDSPulse 0.6s ease-out;
}

.decline-icon {
    width: 80px;
    height: 80px;
    background: #e53e3e;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 30px;
    animation: declinePulse 0.6s ease-out;
}

@keyframes successPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes threeDSPulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes declinePulse {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.transaction-details, .decline-details, .threeds-details, .processing-details {
    background: #f8faff;
    border-radius: 12px;
    padding: 20px;
    margin: 30px 0;
    text-align: left;
}

.threeds-info {
    background: #e6f3ff;
    border-left: 4px solid #3742fa;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.threeds-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.processing-info {
    background: #e8f5e8;
    border-left: 4px solid #48bb78;
    padding: 15px;
    border-radius: 8px;
    margin: 15px 0;
}

.processing-info p {
    margin: 5px 0;
    font-size: 14px;
    color: #555;
}

.transaction-details p, .decline-details p, .threeds-details p, .processing-details p {
    margin-bottom: 10px;
    font-size: 14px;
}

.transaction-details strong, .decline-details strong, .threeds-details strong, .processing-details strong {
    color: #2d3748;
}

/* Messages */
.message-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.message {
    padding: 16px 20px;
    border-radius: 12px;
    margin-bottom: 10px;
    font-weight: 500;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    animation: slideIn 0.3s ease-out;
}

.message.success {
    background: #f0fff4;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.message.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #e53e3e;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.95);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    z-index: 2000;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #e2e8f0;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-overlay p {
    color: #4a5568;
    font-size: 16px;
    font-weight: 500;
}

/* Form Validation */
.form-group.error input,
.form-group.error select {
    border-color: #e53e3e;
    box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1);
}

.form-group.success input,
.form-group.success select {
    border-color: #48bb78;
    box-shadow: 0 0 0 3px rgba(72, 187, 120, 0.1);
}

.error-message {
    color: #e53e3e;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .payment-container {
        grid-template-columns: 1fr;
        max-width: 600px;
        margin: 0 auto;
    }
    
    .left-panel {
        order: 1;
        padding: 30px;
    }
    
    .right-panel {
        order: 2;
        padding: 30px;
    }
    

}

@media (max-width: 768px) {
    .page-background {
        padding: 10px;
    }
    
    .payment-container {
        border-radius: 16px;
        min-height: auto;
    }
    
    .left-panel, .right-panel { padding: 20px; }
    .trust-badges { grid-template-columns: repeat(3, 1fr); }
    .support-box { padding: 12px; }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .step-actions {
        flex-direction: column;
    }
    
    .btn-back, .btn-next, .btn-pay {
        width: 100%;
    }
    
    .payment-methods {
        flex-direction: column;
    }
    
    .step-indicator {
        margin-bottom: 24px;
    }
    
    .step-indicator::before {
        display: none;
    }
    
    .step {
        flex-direction: row;
        justify-content: flex-start;
        gap: 12px;
    }
    
    .step-number {
        width: 32px;
        height: 32px;
        font-size: 12px;
    }
    
    .step-label {
        font-size: 14px;
    }
    

    
    .payment-summary-card {
        padding: 24px;
    }
    
    .amount-container {
        margin: 24px 0;
    }
    
    .amount-value {
        font-size: 40px;
    }
    
    .currency-symbol {
        font-size: 32px;
        margin-top: 6px;
    }
    
    .payment-details {
        margin: 24px 0;
        padding-top: 20px;
    }
    
    .phone-field-container {
        flex-direction: column;
        gap: 16px;
    }
    
    .phone-country-selector {
        flex: none;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .left-panel, .right-panel { padding: 16px; }
    .trust-badges { grid-template-columns: repeat(3, 1fr); gap: 8px; }
    .support-box { padding: 10px; }
    

    
    .payment-summary-card {
        padding: 20px;
    }
    
    .amount-container {
        margin: 20px 0;
    }
    
    .amount-value {
        font-size: 32px;
    }
    
    .currency-symbol {
        font-size: 28px;
        margin-top: 4px;
    }
    
    .payment-details {
        margin: 20px 0;
        padding-top: 16px;
    }
    
    input, select {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    #cardholderName {
        font-size: 16px;
    }
}

/* Compact desktop overrides to reduce overall scale and fit at 100% zoom */
@media (min-width: 769px) {
    /* Compact scale: unify control sizes and reduce vertical spacing */
    .page-background {
        padding: 16px;
    }

    .payment-container {
        min-height: auto;
    }

    .left-panel, .right-panel { padding: 22px; }
    .trust-badges { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .support-box { padding: 12px; }



    .payment-summary-card { padding: 28px; }

    .payment-header { margin-bottom: 20px; }

    .amount-container { margin: 24px 0; }

    .currency-symbol { font-size: 36px; margin-top: 6px; }

    .amount-value { font-size: 48px; }

    .payment-details { padding-top: 20px; margin: 24px 0; }

    .detail-row { margin-bottom: 8px; }

    .detail-row:last-child { padding-top: 8px; }

    .security-features { 
        margin-top: 14px; 
        padding-top: 12px; 
    }

    .payment-methods { margin-bottom: 14px; }

    .payment-method { padding: 10px 14px; font-size: 13px; }

    .step-indicator { margin-bottom: 16px; }

    .step-indicator::before { top: 14px; left: 14px; right: 14px; }

    .step-number { width: 28px; height: 28px; font-size: 11px; }

    .step-label { font-size: 11px; }

    h3 { font-size: 13px; margin-bottom: 10px; }

    .form-group { margin-bottom: 10px; }

    .form-row { gap: 10px; margin-bottom: 10px; }

    label { margin-bottom: 4px; font-size: 12px; }

    /* Enforce uniform control heights */
    input, select { padding: 10px 12px; font-size: 13px; height: 40px; }

    /* Match custom dropdown triggers to input height */
    .selected-country { height: 40px; padding: 0 12px; }
    .phone-selected-country { height: 40px; padding: 0 10px; }

    /* Ensure embedded flag images scale within 44px height */
    .country-flag-container { width: 22px; height: 16px; }
    .country-flag { width: 22px; height: 16px; }
    .phone-country-flag-container { width: 18px; height: 13px; }
    .phone-country-flag-container .country-flag { width: 18px; height: 13px; }

    #cardholderName { font-size: 15px; }

    .card-logo { right: 10px; width: 24px; height: 16px; }

    .expiry-inputs span { font-size: 14px; }

    .payment-summary { padding: 12px; margin-bottom: 12px; }

    .summary-row { font-size: 12px; }

    .summary-row.total { font-size: 14px; padding-top: 8px; margin-top: 4px; }

    .step-actions { gap: 10px; margin-top: 14px; }

    .btn-back, .btn-next, .btn-pay { padding: 12px 16px; font-size: 14px; height: 40px; }

    .btn-pay { font-size: 15px; padding: 12px 16px; }

    /* Align dropdown menus with their triggers; remove fixed min-widths */
    .country-dropdown-list { left: 0; right: 0; width: 100%; min-width: 0; }
    .phone-country-dropdown-list { left: 0; width: 320px; min-width: 320px; }

    /* Reduce dropdown list internal paddings and max-heights for compactness */
    .countries-container, .phone-countries-container { max-height: 160px; }
    .country-item, .phone-country-item { padding: 8px 12px; }
    .country-search-container, .phone-country-search-container { padding: 8px 12px; }
    .country-search-input, .phone-country-search-input { padding: 6px 10px; font-size: 12px; }
}

/* 3DS Authentication Styles */
.threeds-iframe-container {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.threeds-status {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 15px 0;
    font-size: 14px;
    color: #666;
}

.threeds-status.processing {
    background: #e3f2fd;
    color: #1976d2;
}

.threeds-status.success {
    background: #e8f5e8;
    color: #2e7d32;
}

.threeds-status.error {
    background: #ffebee;
    color: #c62828;
}/* Address Autocomplete Styles */
.address-autocomplete-results {
    position: absolute;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    max-height: 300px;
    overflow-y: auto;
    z-index: 10000;
    margin-top: 4px;
}

.address-autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f1f5f9;
}

.address-autocomplete-item:last-child {
    border-bottom: none;
}

.address-autocomplete-item:hover,
.address-autocomplete-item.selected {
    background-color: #f8fafc;
}

.address-autocomplete-item.selected {
    background-color: #eef2ff;
}

.address-main {
    font-size: 14px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 4px;
}

.address-secondary {
    font-size: 12px;
    color: #64748b;
}

.address-autocomplete-results::-webkit-scrollbar {
    width: 6px;
}

.address-autocomplete-results::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.address-autocomplete-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.address-autocomplete-results::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

