/* Standardized styling for all step pages - matches new customer registration page */

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif !important;
    background: linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%) !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 100vh !important;
    color: white !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
}

.container {
    max-width: 800px;
    width: 90%;
    margin: 20px auto;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.header {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    padding: 30px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.header h1 {
    margin: 0;
    font-size: 2.5em;
    font-weight: 300;
    color: #4CAF50;
}

.header p {
    margin: 10px 0 0 0;
    font-size: 1.2em;
    opacity: 0.9;
}

.step-indicator {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    padding: 0 20px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 15px 10px;
    margin: 0 5px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
    border: 2px solid transparent;
}

.step.current {
    background: #2196F3;
    color: white;
    border-color: #1976D2;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.3);
}

.step.completed {
    background: #4CAF50;
    color: white;
    border-color: #388E3C;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.3);
}

.form-container {
    padding: 40px;
    max-width: 100%;
    margin: 0 auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4CAF50;
}

.form-group input, .form-group select, .form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none;
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

.form-group input::placeholder, .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

/* Stripe Elements Card Field Styling */
#card-element {
    padding: 15px 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 5px;
    background: rgba(255, 255, 255, 0.1);
    min-height: 60px;
    display: flex;
    align-items: center;
    transition: border-color 0.3s ease, background 0.3s ease;
    position: relative;
    cursor: pointer;
    /* Removed overflow: hidden - this blocks Safari iframe focus */
}

#card-element:focus-within {
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.15);
}

#card-element:focus-within .StripeElement {
    color: #000000 !important;
}

#card-errors {
    color: #e74c3c;
    font-size: 14px;
    margin-top: 8px;
    min-height: 20px;
}

/* Mobile-specific Stripe Elements styling */
@media (max-width: 768px) {
    #card-element {
        min-height: 70px;
        padding: 18px 15px;
        font-size: 16px; /* Prevents zoom on iOS */
        cursor: pointer;
        /* iOS Safari compatibility - allow user selection and interaction */
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        -webkit-user-select: auto;
        -moz-user-select: auto;
        -ms-user-select: auto;
        user-select: auto;
        /* Ensure no blocking properties */
        overflow: visible;
        transform: none;
        pointer-events: auto;
    }
    
    /* Ensure Stripe Elements are touch-friendly on mobile */
    .StripeElement {
        font-size: 16px !important;
        line-height: 1.4 !important;
        padding: 8px 0 !important;
        color: #000000 !important;
        background: transparent !important;
        border: none !important;
        outline: none !important;
        width: 100% !important;
        height: auto !important;
        min-height: 44px !important; /* iOS minimum touch target */
        cursor: pointer !important;
    }
    
    /* Make sure the input inside StripeElement is clickable */
    .StripeElement input {
        font-size: 16px !important;
        padding: 12px 8px !important;
        border: none !important;
        outline: none !important;
        background: transparent !important;
        color: #000000 !important;
        width: 100% !important;
        height: 44px !important; /* iOS minimum touch target */
        -webkit-appearance: none !important;
        -moz-appearance: none !important;
        appearance: none !important;
        cursor: pointer !important;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    .StripeElement--focus {
        color: #000000 !important;
        background: transparent !important;
    }
    
    .StripeElement--invalid {
        color: #e74c3c !important;
    }
    
    .StripeElement--complete {
        color: #000000 !important;
    }
    
    .StripeElement--empty {
        color: #000000 !important;
    }
    
    .StripeElement input:focus {
        outline: none !important;
        border: none !important;
        background: transparent !important;
        color: #000000 !important;
    }
    
    /* Ensure placeholder text is visible */
    .StripeElement input::placeholder {
        color: #666666 !important;
        opacity: 1 !important;
    }
    
    /* iOS Safari iframe compatibility - minimal interference */
    .StripeElement iframe {
        pointer-events: auto !important;
        touch-action: manipulation !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

/* Additional mobile touch improvements */
@media (max-width: 480px) {
    #card-element {
        min-height: 80px;
        padding: 20px 15px;
    }
    
    .StripeElement {
        min-height: 50px !important;
    }
    
    .StripeElement input {
        height: 50px !important;
        font-size: 18px !important;
    }
}

.form-group select option {
    background: #2d2d2d;
    color: white;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.button-container {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.go-back-btn {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: all 0.3s ease;
    flex: 1;
}

.go-back-btn:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(244, 67, 54, 0.4);
}

.continue-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #388E3C 100%);
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 2;
}

.continue-btn:hover {
    background: linear-gradient(135deg, #388E3C 0%, #2E7D32 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.4);
}

.continue-btn:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Product selection specific styles */
.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    margin: 30px 0;
}

.product-card {
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 30px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    border-color: #4CAF50;
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.3);
}

.product-card.selected {
    border-color: #4CAF50;
    background: rgba(76, 175, 80, 0.1);
    box-shadow: 0 0 25px rgba(76, 175, 80, 0.3);
}

.product-card input[type="radio"] {
    display: none;
}

.product-card h3 {
    color: #4CAF50;
    margin: 0 0 15px 0;
    font-size: 1.8em;
    text-align: center;
    border-bottom: 2px solid rgba(76, 175, 80, 0.3);
    padding-bottom: 10px;
}

.product-card .price {
    font-size: 2.2em;
    font-weight: bold;
    color: #4CAF50;
    margin: 15px 0 10px 0;
    text-align: center;
}

.product-card .product-frequency {
    font-size: 1.1em;
    color: #ccc;
    text-align: center;
    margin-bottom: 20px;
    font-style: italic;
}

.product-programs {
    flex: 1;
    margin: 20px 0;
}

.program {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #4CAF50;
}

.program h4 {
    color: #4CAF50;
    margin: 0 0 8px 0;
    font-size: 1.2em;
    font-weight: 600;
}

.program p {
    color: #ccc;
    line-height: 1.5;
    margin: 0;
    font-size: 0.95em;
}

.product-disclaimer {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 15px;
    margin-top: auto;
    text-align: center;
    font-style: italic;
    color: #aaa;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Contract specific styles */
.contract-container {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
    max-height: 400px;
    overflow-y: auto;
}

.contract-container h3 {
    color: #4CAF50;
    margin-top: 0;
}

.contract-container p {
    color: #ccc;
    line-height: 1.6;
    margin: 10px 0;
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin: 20px 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 10px;
}

.checkbox-group label {
    color: #ccc;
    font-weight: normal;
    margin: 0;
}

/* Payment specific styles */
.payment-summary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 20px;
    margin: 20px 0;
}

.payment-summary h3 {
    color: #4CAF50;
    margin-top: 0;
}

.payment-summary .summary-row {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    padding: 5px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.payment-summary .summary-row:last-child {
    border-bottom: none;
    font-weight: bold;
    font-size: 1.2em;
    color: #4CAF50;
}

/* Thank you page specific styles */
.success-message {
    text-align: center;
    padding: 40px 20px;
}

.success-message h2 {
    color: #4CAF50;
    font-size: 2.5em;
    margin: 0 0 20px 0;
}

.success-message p {
    color: #ccc;
    font-size: 1.2em;
    line-height: 1.6;
    margin: 10px 0;
}

.success-icon {
    font-size: 4em;
    color: #4CAF50;
    margin-bottom: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 5px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 2em;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .step {
        margin: 0;
    }
}

/* Error and success messages */
.error-message {
    background: rgba(255, 235, 59, 0.2);
    border: 1px solid #ffeb3b;
    color: #f44336;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

.recovery-link {
    color: #4CAF50;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.3s ease;
}

.recovery-link:hover {
    color: #45a049;
    text-decoration: none;
}

.success-message {
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid #4CAF50;
    color: #4CAF50;
    padding: 15px;
    border-radius: 5px;
    margin: 20px 0;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #4CAF50;
    animation: spin 1s ease-in-out infinite;
    margin-right: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive centering for mobile and tablet */
@media (max-width: 768px) {
    body {
        padding: 10px;
        align-items: flex-start;
    }
    
    .container {
        width: 95%;
        margin: 10px auto;
    }
    
    .form-container {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .step-indicator {
        flex-direction: column;
        gap: 10px;
    }
    
    .step {
        margin: 0;
    }
    
    .form-row {
        flex-direction: column;
    }
    
    .button-container {
        flex-direction: column;
    }
    
    .continue-btn {
        order: -1;
    }
}
