* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #dc2626;
    --primary-dark: #b91c1c;
    --white: #ffffff;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-900: #111827;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    background: #f8f9fa;
    color: var(--gray-900);
    line-height: 1.6;
    padding: 2rem;
    min-height: 100vh;
}

.container {
    max-width: 680px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: max-width 0.3s ease;
}

.container.expanded {
    max-width: 1100px;
}

.header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.25rem;
    border-bottom: 2px solid var(--gray-200);
}

.header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.375rem;
    letter-spacing: -0.5px;
}

.header p {
    color: var(--gray-600);
    font-size: 0.9375rem;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar-container {
    position: relative;
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 1.5rem;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary) 0%, #991b1b 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-text {
    position: absolute;
    top: -1.75rem;
    right: 0;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--primary);
}

/* Progress Steps */
.progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
}

.step-number {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: var(--gray-200);
    color: var(--gray-600);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: var(--primary);
    color: white;
}

.step.completed .step-number {
    background: #16a34a;
    color: white;
    font-size: 1.25rem;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-600);
    text-align: center;
    white-space: nowrap;
}

.step.active .step-label {
    color: var(--primary);
}

.step-line {
    flex: 1;
    height: 2px;
    background: var(--gray-200);
    margin: 0 0.5rem;
    max-width: 4rem;
}

.step.completed + .step-line {
    background: var(--primary);
}

/* Optional Fields Toggle */
.optional-section {
    margin: 1.5rem 0 1rem 0;
}

.optional-toggle {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    padding: 0.875rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    user-select: none;
}

.optional-toggle:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.optional-toggle span:first-child {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.toggle-icon {
    transition: transform 0.3s ease;
    color: var(--gray-500);
}

.optional-toggle.open .toggle-icon {
    transform: rotate(180deg);
}

#optional-fields {
    padding-top: 1rem;
}

.form-section {
    display: none;
}

.form-section.active {
    display: block;
}

h2 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--gray-900);
    position: relative;
    padding-left: 0.875rem;
}

h2::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--primary);
    border-radius: 2px;
}

h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 1.5rem 0 0.875rem 0;
    color: var(--gray-700);
}

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 600;
    color: var(--gray-700);
    font-size: 0.8125rem;
    letter-spacing: 0.01em;
}

input[type="text"],
input[type="tel"],
input[type="date"],
input[type="number"],
select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--gray-300);
    border-radius: 8px;
    font-size: 0.9375rem;
    transition: all 0.2s ease;
    font-family: inherit;
    background: var(--white);
}

input:hover,
select:hover {
    border-color: var(--gray-400);
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.1);
}

/* Checkbox Styling */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.checkbox-label:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
}

.checkbox-label input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    cursor: pointer;
    accent-color: var(--primary);
}

.checkbox-label span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.form-actions-center {
    display: flex;
    justify-content: center;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    flex: 1;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-secondary:hover {
    background: var(--gray-50);
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Results Section */
.info-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.info-section {
    background: var(--gray-50);
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    padding: 0.75rem;
}

.info-section h3 {
    font-size: 0.75rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: var(--gray-700);
}

.info-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.info-item {
    background: var(--white);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.info-item strong {
    color: var(--gray-600);
    font-weight: 600;
}

.info-item strong::after {
    content: ':';
    margin-right: 0.125rem;
}

/* Debug Section - Collapsible */
.debug-section {
    background: #f5f5f5;
    border: 2px dashed #999;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
}

.debug-toggle {
    background: #fff;
    border: 1px solid #d1d5db;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s;
    user-select: none;
}

.debug-toggle:hover {
    background: #f3f4f6;
}

.debug-content {
    display: none;
    margin-top: 10px;
}

.debug-content.show {
    display: block;
}

#debug-output {
    background: #1f2937;
    color: #d1d5db;
    border: 1px solid #374151;
    border-radius: 6px;
    padding: 15px;
    font-family: 'Courier New', monospace;
    font-size: 11px;
    overflow-x: auto;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
    line-height: 1.5;
}

/* Quotes Section */
.quotes-section {
    margin-top: 30px;
}

#quotes-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    padding-left: 6rem;
}

.quote-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem 1.25rem;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1.25rem;
    align-items: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: visible;
    animation: slideIn 0.3s ease-out;
}

.quote-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.1);
    transform: translateY(-1px);
}

.quote-card.best-price {
    border-color: #16a34a;
    border-width: 2px;
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
}

.quote-card.best-price::before {
    content: '🏆 EN UYGUN';
    position: absolute;
    top: 50%;
    left: -10px;
    transform: translateY(-50%) translateX(-100%);
    background: #16a34a;
    color: white;
    padding: 0.375rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.4);
    white-space: nowrap;
}

.quote-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.quote-company {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--gray-900);
    margin: 0;
    line-height: 1.2;
}

.quote-details {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.quote-proposal {
    font-size: 0.6875rem;
    color: #6b7280;
    background: #f3f4f6;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-family: 'Courier New', monospace;
}

.quote-status {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    border-radius: 12px;
    font-size: 0.625rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.quote-status.received {
    background: #d1fae5;
    color: #065f46;
}

.quote-status.error {
    background: #fee2e2;
    color: #991b1b;
}

.quote-status.pending {
    background: #fef3c7;
    color: #92400e;
}

.quote-price-section {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 180px;
}

.quote-price {
    font-size: 1.625rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    white-space: nowrap;
}

.quote-card.best-price .quote-price {
    color: #16a34a;
}

.quote-actions {
    display: flex;
    gap: 0.375rem;
}

.btn-payment,
.btn-details {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    white-space: nowrap;
}

.btn-payment {
    background: var(--primary);
    color: white;
}

.btn-payment:hover {
    background: var(--primary-dark);
    transform: scale(1.03);
    box-shadow: 0 3px 8px rgba(220, 38, 38, 0.25);
}

.btn-details {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.btn-details:hover {
    background: #e5e7eb;
}

.quote-message {
    font-size: 0.875rem;
    color: #6b7280;
    line-height: 1.5;
    margin-top: 0.25rem;
}

.quotes-status {
    text-align: center;
    padding: 20px;
    color: var(--gray-600);
    font-weight: 600;
}

.loading-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: var(--primary);
    border-radius: 50%;
    margin-right: 8px;
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(0.8);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }

    .info-row {
        grid-template-columns: 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr;
    }

    #quotes-list {
        padding-left: 0;
    }

    .quote-card {
        grid-template-columns: 1fr;
        padding: 1.25rem;
    }

    .quote-card.best-price::before {
        left: 0;
        top: -10px;
        transform: translateY(-100%);
        font-size: 0.625rem;
        padding: 0.25rem 0.625rem;
    }

    .quote-price-section {
        align-items: flex-start;
        text-align: left;
        min-width: auto;
    }

    .quote-actions {
        width: 100%;
        flex-direction: column;
    }

    .btn-payment,
    .btn-details {
        width: 100%;
    }

    .quote-company {
        font-size: 1.25rem;
    }

    .quote-price {
        font-size: 1.875rem;
    }
}
