/* ========================================================================
   Stripe Checkout Styles - Wizard Step 05 Design Match
   Fully responsive with enhanced UI/UX for mobile
   ========================================================================= */

/* Import wizard styles foundation */
@import url('_variables.css');
@import url('_animations.css');

/* Reset and Base Styles */
.aigf-stripe-checkout * {
    box-sizing: border-box;
}

.aigf-stripe-checkout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg-2);
    min-height: 100vh;
}

/* Modern Form Container - Matching Wizard */
.aigf-modern-form {
    background: var(--bg-2);
    overflow: hidden;
    width: 100%;
    padding: 40px 60px;
    min-height: 100vh;
}

.aigf-form-container-new {
    margin: 0 auto;
    width: 100%;
    max-width: 1400px;
    box-sizing: border-box;
}

.step-info h2 {
    color: var(--text-light1);
    font-size: 2.25rem;
    font-weight: 700;
    margin: 0 0 8px 0;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.step-info p {
    color: var(--text-dim1);
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

/* Main Checkout Container - Two Column Layout */
.aigf-checkout-container {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 40px;
    margin-bottom: 40px;
    align-items: start;
}

/* Step Content - Main Form Area */
.aigf-step-content {
    background: var(--bg-1);
    border-radius: 16px;
    padding: 40px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(11, 7, 32, 0.3);
}

/* Field Groups - Matching Wizard Style */
.aigf-field-group-new {
    margin-bottom: 0px;
}

/* Error States */
.aigf-field-error,
.aigf-field-error:focus {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 2px var(--error-bg) !important;
}

.aigf-field-error input,
.aigf-field-error select,
.aigf-field-error textarea {
    border-color: var(--error) !important;
}

.aigf-error-message {
    color: var(--error);
    font-size: var(--font-xs);
    font-weight: var(--font-medium);
    margin-top: var(--spacing-xs);
    display: block;
    line-height: var(--line-height-tight);
}


/* Consent Section */
.aigf-consent-section {
    margin-top: 24px;
    padding: 20px;
    background: var(--glass-bg);
    border-radius: 12px;
    border: 1px solid var(--glass-border);
}

.aigf-consent-field {
    margin: 0;
}

.aigf-consent-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: var(--font-sm);
    line-height: var(--line-height-normal);
    color: var(--text-light1);
}

.aigf-consent-label input[type="checkbox"] {
    margin-top: 2px;
    width: 18px;
    height: 18px;
    accent-color: var(--primary);
    cursor: pointer;
}

.aigf-consent-text {
    flex: 1;
}

.aigf-consent-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* Consent checkbox styled like auth checkbox */
.aigf-consent-label.aigf-checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  color: var(--text-light1);
  font-size: 14px;
}
.aigf-consent-label.aigf-checkbox-label input[type="checkbox"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}
.aigf-consent-label.aigf-checkbox-label input[type="checkbox"] + .checkbox {
  width: 18px;
  height: 18px;
  border-radius: 6px;
  border: 1px solid var(--glass-border);
  display: inline-block;
  position: relative;
  transition: all 0.15s ease;
  background: transparent;
}
.aigf-consent-label.aigf-checkbox-label input[type="checkbox"]:checked + .checkbox {
  background: var(--primary1);
  border-color: var(--primary1);
}
.aigf-consent-label.aigf-checkbox-label input[type="checkbox"]:checked + .checkbox::after {
  content: '✓';
  color: var(--electric-blue);
  font-size: 12px;
  font-weight: bold;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.aigf-consent-link:hover {
    text-decoration: underline;
}


.aigf-field-label-new {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: var(--text-light1);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.field-icon {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.field-optional,
.field-note {
    font-size: 0.8rem;
    color: var(--text-muted1);
    font-weight: 400;
    opacity: 0.7;
}

.aigf-input-wrapper {
    position: relative;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
}

.aigf-input-icon {
    position: absolute;
    left: var(--spacing-lg);
    font-size: var(--font-base);
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.25em;
    height: 1.25em;
    top: 10px;
}

.aigf-field-input-new,
.aigf-select2 {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-sm) var(--spacing-sm) 3em;
    background: var(--bg-1);
    border: 2px solid var(--glass-border);
    border-radius: var(--radius-lg);
    color: var(--text-light1);
    font-size: var(--font-sm);
    transition: all 0.3s ease;
    box-sizing: border-box;
    font-family: var(--font-primary);
    line-height: var(--line-height-normal);
}

.aigf-field-input-new:focus,
.aigf-select2:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-1);
    box-shadow: 0 0 0 3px rgba(155, 93, 229, 0.15);
}

.aigf-field-input-new::placeholder {
    color: var(--text-muted1);
    opacity: 0.7;
}

/* Responsive Icon Sizing */
.aigf-input-icon svg {
    width: 1.25em;
    height: 1.25em;
    color: var(--primary);
    stroke: var(--primary);
}

.aigf-field-label-new .aigf-icon-placeholder svg,
.aigf-field-label-new svg {
    width: 1.125em;
    height: 1.125em;
    margin-right: 0.5em;
}

.aigf-btn-new .aigf-icon-placeholder svg,
.aigf-btn-new svg {
    width: 1em;
    height: 1em;
    margin-right: 0.5em;
}

.aigf-password-toggle .aigf-icon-placeholder svg,
.aigf-password-toggle svg {
    width: 1.25em;
    height: 1.25em;
}

/* Selection Grid */
.aigf-selection-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

/* Account and Payment Sections */
.aigf-account-section,
.aigf-payment-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--glass-border);
}

.aigf-account-section h3,
.aigf-payment-section h3  {
    color: var(--text-light1);
    font-size: 1.3rem;
    margin: 0 0 12px 0;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.aigf-billing-grid h3 {
    color: var(--text-light1);
    font-size: 1.3rem;
    font-weight: 600;
}

.aigf-account-grid,
.aigf-billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 16px;
    row-gap: 0px;
}

.aigf-billing-grid h3 {
    grid-column: 1 / span 2;
    color: var(--text-light1);
}

aigf-country-field {
    grid-column: 1 / span 2;
}

/* Billing grid special layout */
.aigf-billing-grid .aigf-field-group-new:has(input[name="billing_name"]),
.aigf-billing-grid .aigf-field-group-new:has(input[name="billing_address"]) {
    grid-column: 1 / -1; /* Full width for name and address */
}

/* Address field specific styling */
.aigf-billing-grid .aigf-field-group-new:has(input[name="billing_address_2"]) {
    grid-column: 1 / -1; /* Full width for secondary address */
}

/* Country selector styling */
.aigf-billing-grid .aigf-field-group-new:has(select[name="billing_country"]) {
    grid-column: 1 / span 2;
}

@media (min-width: 768px) {
    .aigf-billing-grid .aigf-field-group-new:has(select[name="billing_country"]) {
        grid-column: 1; /* Right column on desktop */
    }
}

/* Responsive billing grid adjustments */
@media (max-width: 768px) {
    .aigf-billing-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .aigf-billing-grid .aigf-field-group-new:has(input[name="billing_name"]),
    .aigf-billing-grid .aigf-field-group-new:has(input[name="billing_address"]) {
        grid-column: 1;
    }
}

/* Password Field */
.aigf-password-field {
    position: relative;
}

.aigf-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted1);
    cursor: pointer;
    padding: 8px;
    border-radius: 4px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.aigf-password-toggle:hover {
    color: var(--text-light1);
    background: rgba(255, 255, 255, 0.1);
}

/* Stripe Elements */
.aigf-stripe-element {
    background: var(--bg-1);
    border: 2px solid var(--glass-border);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
}

.aigf-stripe-element:focus-within,
.aigf-stripe-element--focus {
    border-color: var(--primary);

}

.aigf-card-errors {
    color: var(--error);
    font-size: 0.9rem;
    margin-top: 8px;
    padding: 8px 12px;
    background: var(--error-bg);
    border: 1px solid var(--error-border);
    border-radius: 8px;
}

/* Field Hints and Status */
.aigf-field-hint {
    font-size: 0.85rem;
    color: var(--text-muted1);
    margin-top: 6px;
    opacity: 0.8;
}

.aigf-field-status {
    margin-top: 8px;
    font-size: 0.85rem;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid;
}

.aigf-validation-success .aigf-success-message {
    color: var(--success);
    background: var(--success-bg);
    border-color: var(--success);
}

.aigf-validation-error .aigf-error-message {
    color: var(--error);
    background: var(--error-bg);
    border-color: var(--error);
}

/* Upgrade Notice */
.aigf-upgrade-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 12px;
    margin-bottom: 32px;
}

.upgrade-current,
.upgrade-new {
    text-align: center;
}

.current-label,
.new-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted1);
}

.current-plan-name {
    font-weight: 600;
    color: var(--text-light1);
    font-size: 14px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
}

.upgrade-arrow {
    font-size: 20px;
    color: var(--success);
    font-weight: bold;
}

/* Order Summary Sidebar - Matching Wizard */
.aigf-order-summary {
    background: var(--bg-1);
    border-radius: 16px;
    padding: 32px;
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(11, 7, 32, 0.3);
    position: sticky;
    top: 40px;
    height: fit-content;
}

.aigf-order-summary h3 {
    color: var(--text-light1);
    font-size: 1.4rem;
    margin: 0 0 24px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--glass-border);
    font-weight: 600;
}

.aigf-summary-section {
    margin-bottom: 24px;
}

.aigf-summary-section h4 {
    color: var(--text-dim1);
    font-size: 1rem;
    margin: 0 0 16px 0;
    font-weight: 600;
}

.aigf-summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    padding: 4px;
        border-bottom: 1px solid var(--glass-border);
    
}

.aigf-summary-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.aigf-summary-label {
    color: var(--text-muted1);
    font-weight: 500;
    font-size: 0.9rem;
}

.aigf-summary-value {
    color: var(--text-light1);
    font-weight: 600;
    font-size: 0.9rem;
}

.aigf-discount-amount {
    color: var(--success) !important;
}

.aigf-summary-total {
    border-top: 2px solid var(--primary);
    padding-top: 16px;
    margin-top: 20px;
}

.aigf-total-price {
    font-size: 1.2rem;
    color: var(--primary) !important;
    font-weight: 700;
}

/* Action Buttons - Matching Wizard */
.aigf-summary-actions {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.aigf-btn-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 16px 24px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.aigf-btn-primary-new {
    background: var(--gradient-primary);
    color: var(--text-light1);
    box-shadow: 0 0 20px rgba(155, 93, 229, 0.4);
    border-radius: 50px;
    padding: 16px 28px;
    position: relative;
    overflow: hidden;
}

.aigf-btn-primary-new::after {
    content: "";
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18));
    transition: left 0.5s;
}

.aigf-btn-primary-new:hover:not(:disabled) {
    transform: scale(1.01);
    box-shadow: 0 0 4px rgba(155, 93, 229, 0.6), 0 0 8px rgba(155, 93, 229, 0.3);
}

.aigf-btn-primary-new:hover:not(:disabled)::after {
    left: 100%;
} 

.aigf-btn-secondary-new {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light1);
    border-color: var(--glass-border);
    backdrop-filter: blur(10px);
}

.aigf-btn-secondary-new:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: var(--primary);
    transform: translateY(-1px);
}

.btn-icon {
    font-size: 16px;
}

.aigf-btn-new:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Loading States */
.loading .aigf-btn-primary-new::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    margin: auto;
    border: 2px solid transparent;
    border-top-color: var(--text-light1);
    border-radius: 50%;
    animation: button-loading-spinner 1s ease infinite;
}

@keyframes button-loading-spinner {
    from { transform: rotate(0turn); }
    to { transform: rotate(1turn); }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .aigf-checkout-container {
        grid-template-columns: 1fr 350px;
        gap: 30px;
    }
}

@media (max-width: 1024px) {
    .aigf-checkout-container {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .aigf-order-summary {
        position: static;
        order: -1;
    }
    
    /* Hide the button in order summary on mobile */
    .aigf-summary-actions {
        display: none;
    }
    
    .step-info h2 {
        font-size: 2rem;
    }
}

@media (max-width: 768px) {
    .aigf-modern-form {
        padding: 20px 16px;
    }
    
    .aigf-step-content,
    .aigf-order-summary {
        padding: 16px;
        border-radius: 12px;
    }
    
    .step-info h2 {
        font-size: 1.75rem;
    }
    
    .step-info p {
        font-size: 1rem;
    }
    
    .step-number {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    .stripe-line span {
            font-size: 12px;
    }
    
    .aigf-selection-grid,
    .aigf-account-grid,
    .aigf-billing-grid {
        column-gap: 16px;
        row-gap: 0px;
        grid-template-columns: 1fr;
    }
    .aigf-billing-grid  {
         column-gap: 16px;
        row-gap: 0px;
    }
    
    .aigf-upgrade-notice {
        flex-direction: column;
        gap: 8px;
        padding: 16px;
    }
    
    .upgrade-arrow {
        transform: rotate(90deg);
        font-size: 16px;
    }
    
    .aigf-step-indicator {
        flex-direction: column;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .aigf-modern-form {
        padding: 16px 12px;
    }
    
    .aigf-step-content,
    .aigf-order-summary {
        padding: 20px;
    }
    
    .step-info h2 {
        font-size: 1.5rem;
    }
    
    .aigf-field-input-new,
    .aigf-select2 {
        padding: 14px;
        font-size: 12px; /* Prevents zoom on iOS */
    }

     .aigf-field-input-new {
        padding: 14px 14px 14px 45px;
    }
    
    .aigf-btn-new {
        padding: 14px 20px;
        font-size: 0.95rem;
    }
}

/* Mobile Checkout Button */
.aigf-mobile-checkout-btn {
    display: none;
}

/* Show mobile button on mobile/tablet */
@media (max-width: 1024px) {
    .aigf-mobile-checkout-btn {
        display: block;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Focus Management */
.aigf-field-input-new:focus-visible,
.aigf-btn-new:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .aigf-field-input-new,
    .aigf-select2 {
        border-width: 3px;
    }
    
    .step-number {
        border: 2px solid var(--text-light1);
    }
}

/* Hidden helper for card errors - keep markup present but not visible until needed */
.aigf-card-errors-hidden {
    display: none !important;
}


/* Additional styles specific to checkout page */


.aigf-account-section,
.aigf-payment-section {
    margin-top: 40px;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
}

.aigf-account-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.aigf-billing-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

/* Adjust grid for logged-in users with billing email field */
.aigf-billing-grid:has(#billing-email[type="email"]) {
    grid-template-columns: 1fr 1fr;
}

/* Ensure proper spacing for billing fields */
.aigf-billing-grid .aigf-field-group-new:empty {
    display: none;
}

.aigf-upgrade-notice {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    padding: 20px;
    background: rgba(40, 167, 69, 0.1);
    border: 1px solid rgba(40, 167, 69, 0.3);
    border-radius: 12px;
    margin-bottom: 30px;
}

.current-label,
.new-label {
    font-size: 12px;
    text-transform: uppercase;
    opacity: 0.8;
    display: block;
    margin-bottom: 5px;
}

.current-plan-name {
    font-weight: 600;
    color: var(--text);
}

.upgrade-arrow {
    font-size: 20px;
    color: var(--success);
    font-weight: bold;
}

.aigf-summary-actions {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Password field with icon and toggle button */
.aigf-password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.aigf-password-field .aigf-input-wrapper {
    flex: 1;
}

.aigf-password-field .aigf-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.aigf-password-field .aigf-password-toggle:hover {
    color: var(--primary);
}

.aigf-field-new {
    margin-bottom: 8px;
}

/* Button visibility control for responsive design */
.aigf-mobile-checkout-btn {
    display: none; /* Hidden by default on desktop/tablet */
}

.aigf-mobile-consent-section {
    display: none; /* Hidden by default on desktop/tablet */
}

.aigf-summary-actions {
    display: block; /* Visible by default on desktop/tablet */
}

@media (max-width: 768px) {
    .aigf-selection-grid,
    .aigf-account-grid,
    .aigf-billing-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    
    .aigf-upgrade-notice {
        flex-direction: column;
        gap: 8px;
    }
    
    .upgrade-arrow {
        transform: rotate(90deg);
    }
    
    /* Mobile: Show mobile button and consent, hide desktop versions */
    .aigf-mobile-checkout-btn {
        display: block;
        width: 100%;
        margin-top: 16px;
    }
    
    .aigf-mobile-checkout-btn .aigf-btn-new {
        width: 100%;
        padding: 16px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .aigf-mobile-consent-section {
        display: block;
        margin-top: 0px;
        padding: 16px;
        background: var(--bg-1);
        border-radius: 8px;
        border: 1px solid var(--border);
    }
    
    .aigf-mobile-consent-section .aigf-consent-field {
        margin: 0;
    }
    
    .aigf-mobile-consent-section .aigf-consent-label {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        font-size: 14px;
        line-height: 1.5;
        cursor: pointer;
    }
    
    .aigf-mobile-consent-section .aigf-consent-text {
        flex: 1;
        color: var(--text-secondary);
    }
    
    .aigf-mobile-consent-section .aigf-consent-link {
        color: var(--primary);
        text-decoration: none;
    }
    
    .aigf-mobile-consent-section .aigf-consent-link:hover {
        text-decoration: underline;
    }
    
    .aigf-consent-section {
        display: none; /* Hide desktop consent on mobile */
    }
    
    .aigf-summary-actions {
        display: none; /* Hide desktop button on mobile */
    }
}

/* Trust/Verification Strip */
.aigf-trust-strip {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.aigf-trust-content {
    display: flex;
    align-items: center;
    gap: 12px;
}

.aigf-trust-icons {
    display: flex;
    gap: 8px;
}

.aigf-trust-icons .aigf-icon-placeholder {
    width: 20px;
    height: 20px;
}

.aigf-trust-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.aigf-trust-message {
    font-size: 14px;
    font-weight: 600;
    color: #28a745;
}

.aigf-trust-subtext {
    font-size: 12px;
    color: #6c757d;
}

/* Classic Card Fields Grid */
.aigf-card-fields-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    row-gap: 0px;
    margin-bottom: 12px;
}

.aigf-card-number-field {
grid-column: 1 / span 3;
        grid-row: 1;
    }

.aigf-card-expiry-field,
.aigf-card-cvc-field {
    flex: 1;
}

/* Desktop: 3-column layout for expiry and CVC */
@media (min-width: 768px) {
    .aigf-card-fields-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .aigf-card-number-field {
        grid-column: 1 / span 3;
        grid-row: 1;
    }

    .aigf-card-expiry-field {
        grid-column: 1 / span 2;
        grid-row: 2;
    }

    .aigf-card-cvc-field {
        grid-column: 3 / span 1;
        grid-row: 2;
    }
}

/* Mobile: Stack expiry and CVC */
@media (max-width: 767px) {
    .aigf-card-fields-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .aigf-card-number-field {
        grid-column: 1 / span 3;
        grid-row: 1;
    }

    .aigf-card-expiry-field {
        grid-column: 1 / span 2;
        grid-row: 2;
    }

    .aigf-card-cvc-field {
        grid-column: 3 / span 1;
        grid-row: 2;
    }
}

/* Referral Code Toggle */
.aigf-referral-toggle-section {
    margin-bottom: 24px;
}

.aigf-referral-toggle-prompt {
    margin-bottom: 16px;
}

.aigf-referral-toggle-link {
    font-weight: 600;
    font-size: 18px;
    text-decoration: underline;
    cursor: pointer;
    transition: color 0.2s ease;
}

.aigf-referral-toggle-link:hover {
    color: var(--primary-hover, var(--accent1));
}

.aigf-referral-input-container {
    overflow: hidden;
    transition: all 0.3s ease;
}

.aigf-referral-input-container.showing {
    opacity: 1;
    max-height: 500px; /* Adjust based on content */
}

.aigf-referral-input-container.hiding {
    opacity: 0;
    max-height: 0;
}

.card-number-element svg {
    width: 24px;
    height: 24px;
    margin-right: 10px;
    color: var(--primary);
    stroke: var(--primary);
}

/* Save Badge Styles */
.aigf-save-badge {
    background: linear-gradient(135deg, #ff6b6b, #ee5a24);
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    margin-left: 6px;
    display: inline-block;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.8; }
}

#referral-code {
    max-width: 440px;
    width: 100%;
}

.aigf-create-girlfriend small {
    display: block;
}
#complete-checkout-btn , #mobile-complete-checkout-btn {
    width: 100%;
}