/* General layout */
.tss-pp-card {
    max-width: 900px;
    margin: 40px auto;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    padding: 0;
    color: #374151;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    position: relative;
    overflow: hidden;
    border: 1px solid #f1f5f9;
}

.tss-pp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #9ca3af, #6b7280, #9ca3af); /* mid gray */
    z-index: 1;
}

.tss-pp-centered {
    text-align: center;
}

/* Header */
.tss-pp-header {
    background: linear-gradient(135deg, #fafafa 0%, #f8fafc 100%);
    border-bottom: 1px solid #e2e8f0;
    padding: 40px 48px;
    margin-bottom: 0;
    position: relative;
    animation: fadeInDown 0.6s ease-out;
}

.tss-pp-title {
    font-size: 32px;
    font-weight: 800;
    margin: 0 0 16px 0;
    color: #1f2937;
    letter-spacing: -0.5px;
    position: relative;
}

.tss-pp-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, #9ca3af, #6b7280);
    border-radius: 2px;
}

.tss-pp-desc {
    margin: 0;
    color: #64748b;
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Steps */
.tss-step {
    padding: 48px;
    animation: fadeInUp 0.6s ease-out 0.2s both;
}

.tss-step h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 32px 0;
    text-align: center;
    position: relative;
}

.tss-step h3::before {
    content: '';
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: #9ca3af;
    border-radius: 2px;
}

.tss-input {
    display: block;
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-sizing: border-box;
    font-size: 16px;
    color: #374151;
    transition: all 0.3s ease;
    font-family: inherit;
}

/* Keep consistent style for email/tel types across browsers */
input.tss-input[type="email"], input.tss-input[type="tel"] {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Suppress default invalid red outline and keep our focus style */
input.tss-input:invalid {
    box-shadow: none;
}

/* Enforce uniform look for email/tel against theme overrides */
.tss-pp-card input.tss-input[type="email"],
.tss-pp-card input.tss-input[type="tel"],
.tss-pp-card input.tss-input[type="text"] {
    display: block;
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-sizing: border-box;
    font-size: 16px;
    color: #374151;
    transition: all 0.3s ease;
    font-family: inherit;
}

.tss-pp-card input.tss-input[type="email"]::placeholder,
.tss-pp-card input.tss-input[type="tel"]::placeholder {
    color: #94a3b8;
}

.tss-pp-card input.tss-input[type="email"]:focus,
.tss-pp-card input.tss-input[type="tel"]:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.15);
    transform: translateY(-1px);
}

/* Autofill normalization for consistent background */
.tss-pp-card input.tss-input:-webkit-autofill,
.tss-pp-card input.tss-input:-webkit-autofill:hover,
.tss-pp-card input.tss-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #ffffff inset;
    -webkit-text-fill-color: #374151;
    transition: background-color 5000s ease-in-out 0s;
}

.tss-input::placeholder {
    color: #94a3b8;
}

.tss-input:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.15);
    transform: translateY(-1px);
}

.tss-actions {
    margin-top: 40px;
    display: flex;
    justify-content: center;
    gap: 20px;
}

/* Buttons */
.tss-btn {
    padding: 16px 32px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    background: #ffffff;
    cursor: pointer;
    font-weight: 600;
    font-size: 16px;
    color: #374151;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    min-width: 140px;
}

.tss-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.6s ease;
}

.tss-btn:hover::before {
    left: 100%;
}

.tss-btn:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.tss-btn-primary {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #ffffff;
    border-color: #6b7280;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.tss-btn-primary:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #4b5563;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(107, 114, 128, 0.4);
}

.tss-btn-red {
    background: linear-gradient(135deg, #6b7280, #4b5563);
    color: #ffffff;
    border-color: #6b7280;
    box-shadow: 0 4px 15px rgba(107, 114, 128, 0.3);
}

.tss-btn-red:hover {
    background: linear-gradient(135deg, #4b5563, #374151);
    border-color: #4b5563;
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(107, 114, 128, 0.4);
}

/* Durations grid & cards */
.tss-durations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 32px;
}

.tss-duration-card {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 16px;
    padding: 32px 24px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    animation: fadeInUp 0.6s ease-out calc(var(--delay, 0) * 0.15s) both;
    overflow: hidden;
}

.tss-duration-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #9ca3af, #6b7280);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tss-duration-card:nth-child(1) { --delay: 1; }
.tss-duration-card:nth-child(2) { --delay: 2; }
.tss-duration-card:nth-child(3) { --delay: 3; }

.tss-duration-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
    border-color: #e2e8f0;
}

.tss-duration-selected {
    border-color: #9ca3af;
    box-shadow: 0 15px 35px rgba(156, 163, 175, 0.2);
    transform: translateY(-4px);
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
}

.tss-duration-selected::after {
    content: '✓ SÉLECTIONNÉ';
    position: absolute;
    top: 16px;
    right: 16px;
    background: #6b7280;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    animation: bounceIn 0.5s ease-out;
}

.tss-duration-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 16px;
}

.tss-duration-title {
    font-weight: 700;
    font-size: 20px;
    color: #1f2937;
    letter-spacing: -0.3px;
}

.tss-duration-price {
    font-weight: 800;
    font-size: 18px;
    color: #374151;
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    padding: 10px 16px;
    border-radius: 12px;
    border: 1px solid #d1d5db;
    position: relative;
    white-space: nowrap;
}


/* Perks list */
.tss-perks-list {
    margin: 0;
    padding: 0;
    list-style: disc;
    padding-left: 20px;
    color: #64748b;
    font-size: 15px;
    line-height: 1.7;
}

.tss-perks-list li {
    margin-bottom: 12px;
    opacity: 0;
    animation: slideInLeft 0.4s ease-out calc(var(--item-delay, 0) * 0.1s + 0.5s) both;
}

.tss-perks-list li:nth-child(1) { --item-delay: 1; }
.tss-perks-list li:nth-child(2) { --item-delay: 2; }
.tss-perks-list li:nth-child(3) { --item-delay: 3; }
.tss-perks-list li:nth-child(4) { --item-delay: 4; }

.tss-perks-list li::marker {
    color: #10b981;
}

/* Loader */
#tss-loader {
    padding: 80px 40px;
    color: #64748b;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
}

#tss-loader::after {
    content: '';
    display: block;
    width: 40px;
    height: 40px;
    border: 3px solid #f1f5f9;
    border-radius: 50%;
    border-top-color: #6b7280;
    animation: spin 1s linear infinite;
    margin: 20px auto 0;
}

/* Animations */
@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: scale(0.3);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* Currency Selector */
.tss-currency-selector {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 32px;
}

.tss-currency-selector label {
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
    display: block;
}

.tss-currency-selector select {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 16px;
    color: #374151;
    transition: all 0.3s ease;
    min-width: 200px;
}

.tss-currency-selector select:focus {
    outline: none;
    border-color: #9ca3af;
    box-shadow: 0 0 0 4px rgba(156, 163, 175, 0.15);
}

/* Payment Methods */
.tss-step-description {
    text-align: center;
    color: #64748b;
    font-size: 16px;
    margin-bottom: 32px;
    line-height: 1.6;
}

.tss-payment-methods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.tss-payment-method-card {
    background: #ffffff;
    border: 2px solid #f1f5f9;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    position: relative;
    display: flex;
    align-items: center;
    gap: 16px;
    animation: fadeInUp 0.6s ease-out calc(var(--delay, 0) * 0.1s) both;
    overflow: hidden;
}

.tss-payment-method-card:not(.tss-payment-method-selected) {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tss-payment-method-card:nth-child(1) { --delay: 1; }
.tss-payment-method-card:nth-child(2) { --delay: 2; }
.tss-payment-method-card:nth-child(3) { --delay: 3; }
.tss-payment-method-card:nth-child(4) { --delay: 4; }
.tss-payment-method-card:nth-child(5) { --delay: 5; }

.tss-payment-method-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #9ca3af, #6b7280);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tss-payment-method-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: #e2e8f0;
}

.tss-payment-method-card:focus-within {
    outline: 2px solid #9ca3af;
    outline-offset: 2px;
}

.tss-payment-method-selected {
    border-color: #9ca3af;
    box-shadow: 0 8px 25px rgba(156, 163, 175, 0.15);
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ffffff 0%, #f3f4f6 100%);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tss-payment-method-selected::before {
    transform: scaleX(1);
}

.tss-payment-method-selected::after {
    content: '✓';
    position: absolute;
    top: 12px;
    right: 12px;
    background: #6b7280;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    animation: bounceIn 0.5s ease-out;
}

.tss-payment-method-icon {
    font-size: 32px;
    line-height: 1;
    flex-shrink: 0;
}

.tss-payment-method-info {
    flex: 1;
    min-width: 0;
}

.tss-payment-method-name {
    font-weight: 600;
    font-size: 16px;
    color: #1f2937;
    margin-bottom: 4px;
    line-height: 1.3;
}

.tss-payment-method-country {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

/* Promo row alignment */
.tss-price-promo { display: block; }
.tss-price-promo .tss-promo-row { display: flex; align-items: center; justify-content: flex-start; gap: 10px; flex-wrap: wrap; }
.tss-price-promo .tss-promo-left { display: flex; align-items: center; gap: 8px; }
.tss-price-promo #tss_price_display { font-size: 16px; }
.tss-price-promo .tss-input { min-height: 40px; }
.tss-price-promo .tss-btn { height: 40px; line-height: 40px; padding-top: 0; padding-bottom: 0; }
.tss-price-promo #tss_promo_message { margin-left: 6px; }

.tss-payment-method-radio {
    flex-shrink: 0;
    position: relative;
}

.tss-payment-method-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.tss-payment-method-radio label {
    display: block;
    width: 20px;
    height: 20px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.tss-payment-method-radio input[type="radio"]:checked + label {
    border-color: #6b7280;
    background: #6b7280;
}

.tss-payment-method-radio input[type="radio"]:checked + label::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

/* Responsive */
@media (max-width: 768px) {
    .tss-pp-card {
        margin: 20px;
        border-radius: 16px;
    }
    
    .tss-pp-header {
        padding: 32px 24px;
    }
    
    .tss-pp-title {
        font-size: 28px;
    }
    
    .tss-step {
        padding: 32px 24px;
    }
    
    .tss-step h3 {
        font-size: 20px;
    }
    
    .tss-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .tss-btn {
        width: 100%;
        max-width: 300px;
    }
    
    .tss-durations-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tss-duration-card {
        padding: 24px 20px;
    }
    
    .tss-payment-methods-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .tss-payment-method-card {
        padding: 16px;
        gap: 12px;
    }
    
    .tss-payment-method-icon {
        font-size: 28px;
    }
    
    .tss-payment-method-name {
        font-size: 15px;
    }
    
    .tss-payment-method-country {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .tss-pp-card {
        margin: 16px;
    }
    
    .tss-pp-header {
        padding: 24px 20px;
    }
    
    .tss-step {
        padding: 24px 20px;
    }
    
    .tss-input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .tss-btn {
        padding: 14px 24px;
        font-size: 15px;
    }
    
    .tss-duration-top {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
}