/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
    padding: 0;
    margin: 0;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
    font-weight: 600;
}

header p {
    color: #7f8c8d;
    font-size: 16px;
}

/* Form Styles */
.form-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-section h2 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.3rem;
    padding-bottom: 10px;
    border-bottom: 1px solid #f1f1f1;
}

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
    min-width: 150px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
}

input, textarea, select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border 0.3s;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

input[readonly] {
    background-color: #f8f9fa;
    color: #6c757d;
}

/* Service Items */
.service-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 15px;
    border-left: 4px solid #3498db;
}

.service-total {
    font-weight: bold;
    color: #2c3e50;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

.btn-primary {
    background-color: #3498db;
    color: white;
}

.btn-primary:hover {
    background-color: #2980b9;
}

.btn-secondary {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #ced4da;
}

.btn-secondary:hover {
    background-color: #dee2e6;
}

#add-service {
    margin-bottom: 20px;
}

.form-actions {
    text-align: center;
    margin-top: 30px;
}

/* Total Section */
.total-section {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 6px;
    margin-top: 20px;
}

.total-section .form-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.total-section label {
    margin-bottom: 0;
    font-weight: 600;
}

.total-section input {
    width: 150px;
    text-align: right;
}

.total-section .total {
    border-top: 1px solid #dee2e6;
    padding-top: 15px;
    margin-top: 15px;
}

.total-section .total label {
    color: #2c3e50;
    font-size: 1.1rem;
}

.total-section .total input {
    font-size: 1.2rem;
    font-weight: bold;
    color: #27ae60;
}

/* Proposal Preview */
.proposal-preview {
    background: white;
    border-radius: 8px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.proposal-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
}

.proposal-title {
    color: #2c3e50;
    margin-bottom: 10px;
}

.proposal-client {
    color: #7f8c8d;
    font-size: 18px;
}

.proposal-details {
    margin-bottom: 30px;
}

.proposal-section {
    margin-bottom: 25px;
}

.proposal-section h3 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 1px solid #f1f1f1;
}

.services-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.services-table th, .services-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eaeaea;
}

.services-table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #2c3e50;
}

.services-table tr:last-child td {
    border-bottom: none;
}

.text-right {
    text-align: right;
}

.proposal-total {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #eaeaea;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    font-size: 16px;
}

.grand-total {
    font-weight: bold;
    font-size: 18px;
    color: #27ae60;
    border-top: 1px solid #eaeaea;
    padding-top: 12px;
    margin-top: 8px;
}

/* Signature Section */
.signature-section {
    background: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.signature-container {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    margin: 15px 0;
    background: white;
    overflow: auto;
}

#signature-pad {
    border: 1px dashed #ccc;
    border-radius: 4px;
    background-color: #fafafa;
}

.signature-actions {
    margin-top: 15px;
}

.actions-section {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

/* Success Page */
.success-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80vh;
}

.success-card {
    background: white;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 100%;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #27ae60;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 25px;
}

.success-card h1 {
    color: #2c3e50;
    margin-bottom: 15px;
}

.success-card p {
    color: #7f8c8d;
    margin-bottom: 25px;
    font-size: 16px;
}

.success-details {
    text-align: left;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.success-details p {
    margin-bottom: 10px;
}

.success-actions {
    margin-top: 25px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .form-row .form-group {
        min-width: 100%;
    }
    
    .actions-section {
        flex-direction: column;
    }
    
    .services-table {
        display: block;
        overflow-x: auto;
    }
    
    .signature-container {
        overflow-x: auto;
    }
    
    #signature-pad {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-section {
        padding: 15px;
    }
    
    .proposal-preview {
        padding: 20px;
    }
    
    .success-card {
        padding: 25px;
    }
}