:root {
    --primary-color: #1a237e;
    --secondary-color: #303f9f;
    --accent-color: #5c6bc0;
    --light-gray: #f5f5f5;
    --medium-gray: #e0e0e0;
    --dark-gray: #757575;
    --error-color: #d32f2f;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    margin: 0;
    color: #333;
    background-color: #f9f9f9;
}

.loan-agreement {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    border-radius: 8px;
}

h1, h2, h3 {
    color: var(--primary-color);
}

h1 {
    text-align: center;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-bottom: 30px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--medium-gray);
}

.form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.form-group {
    flex: 1;
    min-width: 200px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--dark-gray);
}

input, select, textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--medium-gray);
    border-radius: 4px;
    font-size: 14px;
    transition: border 0.3s;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--accent-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(92, 107, 192, 0.2);
}

.input-error {
    border-color: var(--error-color);
}

.error-message {
    color: var(--error-color);
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    font-size: 14px;
}

table, th, td {
    border: 1px solid var(--medium-gray);
}

th, td {
    padding: 12px;
    text-align: left;
}

th {
    background-color: var(--light-gray);
    font-weight: 600;
}

.asset-table {
    margin: 20px 0;
    overflow-x: auto;
}

.btn {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
    transition: background 0.3s, transform 0.2s;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--dark-gray);
}

.btn-secondary:hover {
    background: #616161;
}

.add-asset, .remove-asset {
    padding: 8px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}

.add-asset {
    background: var(--primary-color);
    color: white;
    border: none;
    margin-top: 10px;
}

.add-asset:hover {
    background: var(--secondary-color);
}

.remove-asset {
    background: #f44336;
    color: white;
    border: none;
}

.remove-asset:hover {
    background: #d32f2f;
}

.signature-area {
    margin-top: 40px;
}

.signature-line {
    width: 300px;
    border-top: 1px solid #000;
    margin: 40px 0 10px;
    display: inline-block;
}

.terms-box {
    background: var(--light-gray);
    padding: 15px;
    border-left: 3px solid var(--primary-color);
    margin: 15px 0;
    font-size: 14px;
}

.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    position: relative;
}

.progress-bar:before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--medium-gray);
    z-index: 1;
}

.progress-step {
    position: relative;
    z-index: 2;
    text-align: center;
    width: 24%;
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--medium-gray);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: bold;
}

.step-active .step-number {
    background: var(--primary-color);
}

.step-complete .step-number {
    background: var(--secondary-color);
}

.step-label {
    font-size: 12px;
    color: var(--dark-gray);
}

.form-section {
    display: none;
}

.section-active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 30px;
}

.summary-section {
    background: var(--light-gray);
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.summary-row {
    display: flex;
    margin-bottom: 10px;
}

.summary-label {
    font-weight: 600;
    width: 200px;
    color: var(--dark-gray);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    display: none;
}

.spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.success-message {
    text-align: center;
    padding: 20px;
    background: #4caf50;
    color: white;
    border-radius: 8px;
    margin-top: 20px;
    display: none;
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group {
        min-width: 100%;
    }
    
    .progress-step {
        width: 23%;
    }
    
    .step-label {
        font-size: 10px;
    }
}