* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #333;
}

.container {
    background: white;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.header {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    padding: 25px;
    text-align: center;
}

.header h1 {
    font-size: 24px;
    margin-bottom: 5px;
}

.header p {
    opacity: 0.9;
    font-size: 14px;
}

.form-container {
    padding: 25px;
}

.form-section {
    display: block;
}

.payment-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
    color: #4b5563;
}

input, select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s;
    background-color: #f9fafb;
}

input:focus, select:focus {
    outline: none;
    border-color: #4f46e5;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

input.invalid {
    border-color: #ef4444;
    background-color: #fef2f2;
}

.radio-group {
    display: flex;
    gap: 20px;
    margin-top: 5px;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 5px;
}

.radio-option input {
    width: auto;
}

.btn {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    transition: all 0.3s;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 7px 15px rgba(79, 70, 229, 0.3);
}

.btn:active {
    transform: translateY(0);
}

.payment-header {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    background: #f0f9ff;
    border-radius: 10px;
    border-left: 4px solid #4f46e5;
}

.payment-header h3 {
    color: #4f46e5;
    margin-bottom: 5px;
}

.payment-header p {
    color: #6b7280;
    font-size: 14px;
}

.card-icons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.card-icon {
    width: 50px;
    height: 30px;
    background: #f3f4f6;
    border-radius: 5px;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #6b7280;
    font-size: 18px;
    border: 1px solid #e5e7eb;
}

.card-icon.active {
    border-color: #4f46e5;
    color: #4f46e5;
    background: #eef2ff;
}

.card-details {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 15px;
}

.progress-bar {
    display: flex;
    margin-bottom: 30px;
    position: relative;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    z-index: 2;
}

.step-number {
    width: 30px;
    height: 30px;
    background: #e5e7eb;
    color: #6b7280;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 8px;
    font-weight: 600;
    font-size: 14px;
}

.step-name {
    font-size: 12px;
    color: #9ca3af;
    font-weight: 500;
}

.progress-step.active .step-number {
    background: #4f46e5;
    color: white;
}

.progress-step.active .step-name {
    color: #4f46e5;
    font-weight: 600;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 1;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    width: 50%;
    height: 2px;
    background: #4f46e5;
    z-index: 1;
    transition: width 0.3s ease;
}

.payment-active .progress-bar::after {
    width: 100%;
}

.small-button-group {
    display: flex;
    gap: 15px;
}

.small-button-group .form-group {
    flex: 1;
}

.small-button-group .form-group.expiry-date {
    flex: 0 0 50%; /* Expiry Date takes exactly 50% */
}

.small-button-group .form-group.cvc {
    flex: 0 0 50%; /* CVC takes exactly 50% */
}

.small-button-group .form-group.expiry-date input,
.small-button-group .form-group.cvc input {
    width: 100%;
}

.error-message {
    display: none;
    text-align: center;
    padding: 40px 20px;
    animation: fadeIn 0.5s ease;
}

.error-icon {
    width: 80px;
    height: 80px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto 20px;
    font-size: 36px;
}

.error-message h2 {
    color: #ef4444;
    margin-bottom: 10px;
}

.error-message p {
    color: #6b7280;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .container {
        border-radius: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .form-container {
        padding: 20px;
    }
    
    .card-details {
        grid-template-columns: 1fr;
    }
    
    .progress-step .step-name {
        font-size: 10px;
    }
    
    .small-button-group {
        flex-direction: column;
        gap: 20px;
    }
    
    .small-button-group .form-group.expiry-date,
    .small-button-group .form-group.cvc {
        flex: 1; /* Stack vertically on small screens */
    }
}