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

body {
    font-family: 'Noto Sans Devanagari', Arial, sans-serif;
    background-color: #faf9f7;
    padding: 20px;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

.download-btn, .reset-btn {
    padding: 12px 30px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.download-btn {
    background-color: #007bff;
    color: white;
}

.download-btn:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,123,255,0.3);
}

.reset-btn {
    background-color: #6c757d;
    color: white;
}

.reset-btn:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(108,117,125,0.3);
}

.document {
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    line-height: 2;
    font-size: 16px;
    min-height: 600px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

.title {
    text-align: center;
    font-size: 24px;
    font-weight: bold;
    margin-bottom: 30px;
    color: #333;
}

.form-line {
    margin-bottom: 15px;
    line-height: 2.5;
}

.form-line span {
    display: inline;
}

.editable-field {
    border: none;
    border-bottom: 2px solid #007bff;
    background: transparent;
    padding: 2px 8px;
    font-size: 16px;
    font-family: inherit;
    color: #007bff;
    font-weight: bold;
    min-width: 80px;
    max-width: 250px;
    text-align: center;
    display: inline-block;
    vertical-align: baseline;
    margin: 0 3px;
}

.editable-field::placeholder {
    color: #b3d9ff;
    opacity: 1;
}

.editable-field:focus {
    outline: none;
    border-bottom-color: #0056b3;
    background-color: #f8f9fa;
}

.editable-field[readonly] {
    background-color: #f0f0f0;
    cursor: not-allowed;
    border-bottom-color: #6c757d;
    color: #495057;
}

.long-field {
    min-width: 120px;
    max-width: 400px;
}

.signature-section {
    margin-top: 60px;
    text-align: right;
}

.signature-field {
    min-width: 200px;
    text-align: center;
    margin-bottom: 10px;
}

.signature-details {
    font-size: 14px;
    margin-bottom: 20px;
    color: #666;
}

.mobile-line {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
}

.mobile-field {
    min-width: 120px;
}

.download-section {
    margin-top: 30px;
    text-align: center;
    padding: 20px;
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
}

/* Print styles for better image generation */
@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .toolbar {
        display: none;
    }
    
    .document {
        box-shadow: none;
        border-radius: 0;
    }
}

/* Responsive design - mobile view */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .document {
        padding: 30px 20px;
        font-size: 15px;
        border-radius: 4px;
        max-width: 100%;
    }
    
    .title {
        font-size: 20px;
        margin-bottom: 25px;
    }
    
    .form-line {
        line-height: 2.2;
    }
    
    .editable-field {
        font-size: 15px;
        min-width: 70px;
        max-width: 180px;
        padding: 2px 5px;
    }
    
    .long-field {
        max-width: 280px;
    }
    
    .signature-section {
        margin-top: 40px;
    }
    
    .signature-field {
        min-width: 180px;
        font-size: 15px;
    }
    
    .download-section {
        padding: 15px 10px;
        margin-top: 20px;
    }
    
    .download-btn, .reset-btn {
        padding: 10px 20px;
        font-size: 14px;
        width: 100%;
        max-width: 200px;
    }
}

/* Authentication Styles */
.auth-container {
    max-width: 400px;
    margin: 100px auto;
    padding: 40px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    text-align: center;
}

.auth-header h2 {
    color: #333;
    margin-bottom: 10px;
    font-size: 28px;
}

.auth-header p {
    color: #666;
    margin-bottom: 30px;
}

.auth-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.auth-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.auth-btn.primary {
    background-color: #007bff;
    color: white;
}

.auth-btn.primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,123,255,0.3);
}

.auth-btn.secondary {
    background-color: #6c757d;
    color: white;
}

.auth-btn.secondary:hover {
    background-color: #5a6268;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(108,117,125,0.3);
}

.auth-btn.full-width {
    width: 100%;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 12px;
    max-width: 450px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.2);
    animation: slideDown 0.3s ease;
}

.close {
    color: #aaa;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    line-height: 20px;
}

.close:hover,
.close:focus {
    color: #000;
}

.modal-content h2 {
    color: #333;
    margin-bottom: 30px;
    margin-top: 0;
}

.form-group {
    margin-bottom: 20px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #007bff;
}

.auth-link {
    text-align: center;
    margin-top: 20px;
    color: #666;
}

.auth-link a {
    color: #007bff;
    text-decoration: none;
    font-weight: 600;
}

.auth-link a:hover {
    text-decoration: underline;
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.6;
    transition: opacity 0.2s;
}

.toggle-password:hover {
    opacity: 1;
}

.toggle-password:focus {
    outline: 2px solid #007bff;
    outline-offset: 2px;
    border-radius: 3px;
}

.eye-icon {
    display: block;
    user-select: none;
}

/* User Bar */
.user-bar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.user-bar span {
    font-weight: 600;
}

.logout-btn {
    background-color: rgba(255,255,255,0.2);
    color: white;
    border: 2px solid white;
    padding: 8px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.logout-btn:hover {
    background-color: white;
    color: #667eea;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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