/* Used Tractor Loan Page Styles */
.new-loan-hero {
    position: relative;
    background: linear-gradient(90deg, #0f172a 30%, rgba(15, 23, 42, 0.8) 50%, rgba(15, 23, 42, 0) 100%), url('../../assets/images/new_tractor_hero.png');
    background-size: cover;
    background-position: center;
    color: white;
    padding: 4rem 1rem;
    margin-bottom: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
}

.loan-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    text-align: center;
}

.feature-icon {
    font-size: 2rem;
    margin-bottom: 1rem;
    display: block;
}

.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.loan-modal {
    background: white;
    width: 750px;
    /* Wider for sidebar */
    max-width: 95%;
    height: 550px;
    /* Fixed height */
    border-radius: 16px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    /* Sidebar Layout */
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Sidebar Styling */
.modal-sidebar {
    width: 210px;
    background: #f8fafc;
    border-right: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    padding: 2rem 1.5rem;
    flex-shrink: 0;
}

.step-item {
    display: flex;
    align-items: flex-start;
    gap: 1.25rem;
    color: #94a3b8;
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    min-height: 4.5rem;
    /* Ensure height for lines */
}

.step-item:last-child {
    min-height: auto;
}

.step-number {
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1;
    position: relative;
    z-index: 2;
}

.step-text {
    font-size: 0.9rem;
    line-height: 1.3;
    margin-top: 2px;
}

.step-item::after {
    content: '';
    position: absolute;
    top: 24px;
    left: 6px;
    /* Align with number center */
    width: 2px;
    height: calc(100% - 10px);
    background: #e2e8f0;
    z-index: 1;
}

.step-item:last-child::after {
    display: none;
}

.step-item.active {
    color: #0f172a;
}

.step-item.active .step-number {
    color: #0f172a;
}

.step-item.completed {
    color: #0f172a;
}

.step-item.completed .step-number {
    color: #10b981;
    /* Green check implicit */
}

.step-item.completed::after {
    background: #10b981;
}

/* Main Content Area */
.modal-content {
    flex: 1;
    padding: 2rem 2.5rem;
    position: relative;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow-y: auto;
    /* Scroll internally */
}

.modal-close {
    position: absolute;
    top: 1rem;
    right: 1.2rem;
    cursor: pointer;
    font-size: 1.5rem;
    color: #64748b;
    z-index: 10;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.form-step {
    display: none;
    flex-direction: column;
    height: 100%;
}

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

.form-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-family: 'Outfit', sans-serif;
}

.form-subtitle {
    color: #64748b;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
}

.modal-footer {
    margin-top: auto;
    /* Push to bottom */
    display: flex;
    justify-content: flex-end;
    /* Right align buttons */
    gap: 1rem;
    padding-top: 1.5rem;
}

.btn-cancel {
    color: #64748b;
    font-weight: 600;
    cursor: pointer;
    background: none;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: #f8fafc;
    color: #0f172a;
}

.btn-next,
.btn-submit {
    background: #0f172a;
    color: white;
    padding: 0.6rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-size: 0.95rem;
    transition: transform 0.2s, background 0.2s;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.btn-next:hover,
.btn-submit:hover {
    background: #1e293b;
    transform: translateY(-1px);
}

/* Modern Form Controls */
.form-group {
    margin-bottom: 1.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.2rem;
    color: #94a3b8;
    pointer-events: none;
}

.form-control {
    width: 100%;
    padding: 0.7rem 1rem;
    /* Compact padding */
    padding-left: 3rem;
    font-size: 0.9rem;
    /* Smaller font */
    color: #0f172a;
    border: 1.5px solid #f1f5f9;
    background: #f8fafc;
    border-radius: 8px;
    /* Slightly tighter radius */
    transition: all 0.2s;
}

select.form-control {
    padding-left: 1rem;
    /* Reset for selects if no icon */
}

.form-control:focus {
    outline: none;
    border-color: #0f172a;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.05);
}

.form-control::placeholder {
    color: #cbd5e1;
}

.form-label {
    font-size: 0.8rem;
    display: block;
    margin-bottom: 0.4rem;
    color: #64748b;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.radio-group {
    display: flex;
    gap: 1.5rem;
    background: #f8fafc;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    border: 1.5px solid #f1f5f9;
}

.radio-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    color: #64748b;
    font-weight: 500;
}

.radio-item input[type="radio"] {
    accent-color: #0f172a;
    width: 1rem;
    height: 1rem;
}

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

.form-grid.triple {
    grid-template-columns: repeat(3, 1fr);
}

/* Step 5 Adjustments */
#modal-step-5 {
    text-align: center;
    padding: 3rem 2rem;
    justify-content: center;
}

#modal-step-5 .success-icon {
    font-size: 4rem;
    margin-bottom: 1.5rem;
    display: block;
}

/* Start of Manual Fixes for Mobile */
@media (max-width: 768px) {
    .new-loan-hero {
        padding: 3rem 1rem;
    }

    .form-grid,
    .form-grid.triple {
        grid-template-columns: 1fr;
        gap: 0.8rem;
    }

    .loan-modal {
        flex-direction: column;
        height: auto;
        min-height: 80vh;
        max-height: 90vh;
    }

    .modal-sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        overflow-x: auto;
        padding: 1rem;
        border-bottom: 1px solid #e2e8f0;
        border-right: none;
    }

    .step-item {
        min-width: 100px;
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-height: auto;
        gap: 0.5rem;
    }

    .step-item::after {
        display: none;
    }

    .modal-content {
        padding: 1.5rem;
    }
}