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

:root {
    --primary-color: #8b7355;
    --primary-dark: #6b5d47;
    --secondary-color: #a08d75;
    --success-color: #7a8b5a;
    --danger-color: #c97d7d;
    --warning-color: #b89d6b;
    --bg-color: #f5f1eb;
    --card-bg: #faf8f4;
    --panel-bg: #f9f7f2;
    --border-color: #d4c9b8;
    --border-dark: #b8a895;
    --text-primary: #3a3a3a;
    --text-secondary: #6b6b6b;
    --text-dark: #2a2a2a;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.12);
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
}

body {
    font-family: Georgia, 'Times New Roman', Times, serif;
    background: #f0ebe3;
    min-height: 100vh;
    padding: 2rem 1rem;
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    overflow: hidden;
    animation: fadeInUp 0.6s ease-out;
}

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

.header {
    background: var(--panel-bg);
    border-bottom: 2px solid var(--border-color);
    color: var(--text-dark);
    padding: 2.5rem 2rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(139, 115, 85, 0.05) 0%, rgba(160, 141, 117, 0.05) 100%);
    pointer-events: none;
}

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

.header-content {
    position: relative;
    z-index: 1;
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: var(--text-dark);
}

.header h1 i {
    font-size: 2rem;
    color: var(--primary-color);
}

.subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Progress Container */
.progress-container {
    background: var(--bg-color);
    padding: 2rem;
    border-bottom: 1px solid var(--border-dark);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 2rem;
    position: relative;
    border: 1px solid var(--border-dark);
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: var(--radius-lg);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 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%); }
}

.step-indicator {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.step {
    flex: 1;
    min-width: 80px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.5;
}

.step.active {
    opacity: 1;
}

.step.completed .step-number {
    background: var(--success-color);
    color: white;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.5rem;
    font-weight: 600;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step.active .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
    transform: scale(1.1);
    box-shadow: 0 0 0 4px rgba(139, 115, 85, 0.2);
}

.step-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

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

/* Form Styles */
.rfq-form {
    padding: 2rem;
}

.form-step {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

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

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

.step-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.step-header h2 {
    font-size: 1.75rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.step-header h2 i {
    color: var(--primary-color);
    opacity: 0.8;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.required {
    color: var(--danger-color);
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
input[type="number"],
input[type="url"],
textarea,
select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-md);
    font-size: 1rem;
    transition: all 0.3s ease;
    background: #ffffff;
    color: var(--text-primary);
    font-family: inherit;
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 115, 85, 0.15);
    transform: translateY(-1px);
    background: #ffffff;
}

input.error,
textarea.error,
select.error {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

input.error:focus,
textarea.error:focus,
select.error:focus {
    border-color: var(--danger-color);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
}

.section-divider {
    margin: 2rem 0 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-dark);
}

.section-divider h3 {
    font-size: 1.25rem;
    color: var(--text-primary);
    font-weight: 600;
}

/* Dynamic Lists */
.deliverable-item,
.requirement-item,
.milestone-item,
.criteria-item,
.timeline-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-start;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.deliverable-item input,
.requirement-item input,
.milestone-item input:not([type="date"]),
.criteria-item input:not([type="number"]),
.timeline-item input:not([type="date"]):not([type="datetime-local"]) {
    flex: 1;
}

.milestone-item {
    display: grid;
    grid-template-columns: 1fr 2fr 1fr auto;
    gap: 0.75rem;
}

.criteria-item {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 1rem;
}

.btn-remove,
.btn-remove-role {
    background: var(--danger-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-remove:hover,
.btn-remove-role:hover {
    background: #dc2626;
    transform: scale(1.1);
    box-shadow: var(--shadow-md);
}

.btn-add,
.btn-add-role,
.btn-add-small {
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: var(--radius-md);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.btn-add-small {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

.btn-add:hover,
.btn-add-role:hover,
.btn-add-small:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-add:active,
.btn-add-role:active,
.btn-add-small:active {
    transform: translateY(0);
}

/* Role Section */
.role-section {
    background: var(--panel-bg);
    border: 1px solid var(--border-dark);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

.role-section:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    background: #faf9f6;
}

.role-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-dark);
}

.role-header h3 {
    color: var(--primary-color);
    font-size: 1.25rem;
    font-weight: 700;
}

.checkbox-group {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.checkbox-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: normal;
    cursor: pointer;
    margin-bottom: 0;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.list-container {
    margin-bottom: 0.5rem;
}

.list-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    align-items: center;
}

.list-item input {
    flex: 1;
}

.list-item .btn-remove {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
}

/* Criteria Total */
.criteria-total {
    margin-top: 1.5rem;
    padding: 1rem;
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    text-align: center;
    font-size: 1.1rem;
}

.criteria-total strong {
    color: var(--text-primary);
}

.error-message {
    color: var(--danger-color);
    font-size: 0.9rem;
    margin-left: 1rem;
}

/* Checklist */
.checklist-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: var(--panel-bg);
    border-radius: var(--radius-md);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.checklist-item:hover {
    background: #f7f5f0;
    border-color: var(--border-dark);
}

.checklist-item input[type="checkbox"] {
    width: auto;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checklist-item label {
    margin: 0;
    cursor: pointer;
    flex: 1;
    font-weight: normal;
}

.input-with-unit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-with-unit input {
    flex: 1;
}

.input-with-unit span {
    color: var(--text-secondary);
    font-weight: 600;
    min-width: 50px;
}

/* Navigation Buttons */
.form-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-dark);
    flex-wrap: wrap;
    gap: 1rem;
}

.nav-buttons-right {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.875rem 2rem;
    border: none;
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: white;
}

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

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-dark);
}

.btn:active {
    transform: translateY(0);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 1rem 0.5rem;
    }

    .header {
        padding: 2rem 1.5rem;
    }

    .header h1 {
        font-size: 2rem;
    }

    .progress-container {
        padding: 1.5rem 1rem;
    }

    .step-indicator {
        gap: 0.5rem;
    }

    .step {
        min-width: 60px;
    }

    .step-number {
        width: 32px;
        height: 32px;
        font-size: 0.85rem;
    }

    .step-label {
        font-size: 0.65rem;
    }

    .rfq-form {
        padding: 1.5rem 1rem;
    }

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

    .milestone-item {
        grid-template-columns: 1fr;
    }

    .criteria-item,
    .timeline-item {
        grid-template-columns: 1fr;
    }

    .form-navigation {
        flex-direction: column;
    }

    .nav-buttons-right {
        width: 100%;
        flex-direction: column;
    }

    .btn {
        width: 100%;
        justify-content: center;
    }
}

/* Loading Animation */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

/* Print Styles */
@media print {
    body {
        background: white;
        padding: 0;
    }

    .container {
        box-shadow: none;
    }

    .header,
    .progress-container,
    .form-navigation {
        display: none;
    }

    .form-step {
        display: block !important;
    }
}

