/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&display=swap');

/* Main Container */
.contract-generator-container {
    max-width: 1000px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: 'Montserrat', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    line-height: 1.6;
    color: #333;
    font-size: 15px;
}

/* Header */
.contract-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.contract-header h1 {
    color: #d4af37;
    margin: 0 0 10px;
    font-size: 32px;
    font-weight: 700;
}

.contract-header p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

/* Form Wrapper */
.contract-form-wrapper {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.06);
    padding: 40px;
    margin-bottom: 40px;
    border-top: 4px solid #d4af37;
}

/* Notices */
.notice {
    padding: 15px 20px;
    margin: 0 0 25px 0;
    border-radius: 6px;
    font-size: 15px;
    line-height: 1.5;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    animation: fadeIn 0.3s ease-in-out;
}

.notice p {
    margin: 0 0 10px 0;
}

.notice p:last-child {
    margin-bottom: 0;
}

.notice-success {
    background-color: #edf7ed;
    border-left: 4px solid #4caf50;
    color: #1e4620;
}

.notice-error {
    background-color: #fdeded;
    border-left: 4px solid #f44336;
    color: #5f2120;
}

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

/* Headings */
h2 {
    color: #2c3e50;
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #eee;
}

h3 {
    color: #34495e;
    margin: 25px 0 15px;
    padding-bottom: 5px;
    border-bottom: 1px solid #eee;
}

/* Form Sections */
.form-section {
    margin-bottom: 35px;
    padding: 25px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #eee;
    transition: all 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.05);
    transform: translateY(-2px);
}

.form-section h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* Form Groups */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
    font-size: 0.9em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group input[type="url"],
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: #f9f9f9;
    font-family: 'Montserrat', sans-serif;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #d4af37;
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
    outline: none;
    background-color: #fff;
}

/* Radio and Checkbox Styles */
.radio-group label {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    cursor: pointer;
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.radio-group input[type="radio"],
.radio-group input[type="checkbox"] {
    margin-right: 10px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .contract-form-wrapper {
        padding: 25px;
    }
    
    .form-section {
        padding: 20px;
    }
    
    .half {
        width: 100%;
        margin-right: 0;
    }
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: #3498db;
    outline: none;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.2);
}

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

/* Half-width form groups */
.half {
    width: 48%;
    display: inline-block;
    margin-right: 2%;
    vertical-align: top;
}

.half:last-child {
    margin-right: 0;
}

/* Radio and Checkbox Groups */
.radio-group {
    margin-top: 10px;
}

.radio-group label {
    display: block;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"],
.radio-group input[type="checkbox"] {
    margin-right: 8px;
}

/* Buttons */
.button {
    display: inline-block;
    padding: 12px 28px;
    background: #f8f9fa;
    color: #333;
    border: 2px solid #e0e0e0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.button:hover {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

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

.button-primary {
    background: #d4af37;
    color: #fff;
    border-color: #c19b2e;
    padding: 14px 32px;
    font-size: 16px;
}

.button-primary:hover {
    background: #c19b2e;
    border-color: #a8871f;
    color: #fff;
}

/* Form Actions */
.form-actions {
    margin-top: 25px;
    text-align: right;
}

/* Contract Preview */
.contract-preview {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 30px;
    margin-bottom: 30px;
}

.contract-content {
    max-height: 500px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    margin: 20px 0;
    line-height: 1.7;
}

.contract-content h1 {
    text-align: center;
    color: #2c3e50;
    margin-bottom: 30px;
}

.contract-section {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #eee;
}

.contract-section:last-child {
    border-bottom: none;
}

/* Signature Pads */
.signature-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
}

.signature-box {
    margin-bottom: 25px;
}

.signature-pad {
    position: relative;
    width: 100%;
    height: 150px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 4px;
    margin-top: 10px;
}

.signature-pad canvas {
    width: 100%;
    height: 100%;
    cursor: crosshair;
}

.clear-signature {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.clear-signature:hover {
    background: #c0392b;
}

/* Download Section */
.download-section {
    text-align: center;
    padding: 60px 20px;
    margin: 40px 0;
    animation: fadeIn 0.6s ease-out;
}

.success-message {
    background: #fff;
    padding: 50px 30px;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.08);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
    border-top: 4px solid #4caf50;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 40px;
    margin: 0 auto 25px;
    animation: bounceIn 0.8s cubic-bezier(0.215, 0.61, 0.355, 1) both;
}

.success-message h3 {
    color: #2e7d32;
    font-size: 28px;
    margin-bottom: 15px;
    font-weight: 600;
}

.success-message p {
    color: #555;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 25px;
    max-width: 80%;
    margin-left: auto;
    margin-right: auto;
}

/* Button Icons */
.button {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.button .button-text {
    display: inline-block;
    position: relative;
    transition: all 0.3s ease;
}

.button .button-icon {
    display: inline-block;
    margin-left: 8px;
    position: relative;
    transition: all 0.3s ease;
    transform: translateX(-5px);
    opacity: 0;
}

.button:hover .button-text {
    transform: translateX(-5px);
}

.button:hover .button-icon {
    transform: translateX(0);
    opacity: 1;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bounceIn {
    0% { transform: scale(0.3); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    70% { transform: scale(0.9); }
    100% { transform: scale(1); }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .half {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .form-section {
        padding: 15px;
    }
    
    .contract-form-wrapper,
    .contract-preview {
        padding: 20px 15px;
    }
}

/* Responsive Adjustments for Success Message */
@media (max-width: 600px) {
    .success-message {
        padding: 30px 20px;
    }
    
    .success-icon {
        width: 60px;
        height: 60px;
        font-size: 30px;
    }
    
    .success-message h3 {
        font-size: 24px;
    }
    
    .success-message p {
        max-width: 100%;
        font-size: 15px;
    }
}

/* Print Styles */
@media print {
    .contract-generator-container > *:not(.contract-content) {
        display: none !important;
    }
    
    .contract-content {
        max-height: none;
        overflow: visible;
        border: none;
        padding: 0;
    }
    
    .contract-section {
        page-break-inside: avoid;
    }
    
    .signature-fields {
        margin-top: 100px;
    }
    
    .signature-field {
        margin-top: 50px;
        width: 45%;
        display: inline-block;
    }
}
