Contact Us - Sofpetohana
* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}
body {
background-color: #f9fafb;
color: #333;
line-height: 1.6;
padding: 20px;
display: flex;
justify-content: center;
align-items: center;
min-height: 100vh;
}
.contact-container {
background: white;
border-radius: 12px;
box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
width: 100%;
max-width: 600px;
overflow: hidden;
}
.contact-header {
background: linear-gradient(135deg, #2c3e50 0%, #4a6580 100%);
color: white;
padding: 25px 30px;
text-align: center;
}
.contact-header h1 {
font-size: 28px;
margin-bottom: 10px;
display: flex;
align-items: center;
justify-content: center;
}
.contact-header h1 i {
margin-right: 12px;
color: #ff6b6b;
}
.contact-header p {
font-size: 16px;
opacity: 0.9;
}
.contact-form {
padding: 30px;
}
.form-group {
margin-bottom: 20px;
}
label {
display: block;
margin-bottom: 8px;
font-weight: 600;
color: #2c3e50;
}
input, textarea, select {
width: 100%;
padding: 14px 16px;
border: 1px solid #ddd;
border-radius: 8px;
font-size: 16px;
transition: all 0.3s;
}
input:focus, textarea:focus, select:focus {
border-color: #4a6580;
outline: none;
box-shadow: 0 0 0 3px rgba(74, 101, 128, 0.2);
}
textarea {
min-height: 140px;
resize: vertical;
}
.required::after {
content: " *";
color: #e74c3c;
}
.submit-btn {
background: #4a6580;
color: white;
border: none;
padding: 16px;
font-size: 17px;
border-radius: 8px;
cursor: pointer;
transition: background 0.3s;
font-weight: 600;
width: 100%;
margin-top: 10px;
}
.submit-btn:hover {
background: #2c3e50;
}
.submit-btn i {
margin-right: 8px;
}
.form-footer {
text-align: center;
margin-top: 25px;
color: #7f8c8d;
font-size: 14px;
}
.form-footer a {
color: #4a6580;
text-decoration: none;
font-weight: 600;
}
.form-footer a:hover {
text-decoration: underline;
}
.success-message {
display: none;
background: #d4edda;
color: #155724;
padding: 16px;
border-radius: 8px;
margin-top: 20px;
text-align: center;
}
@media (max-width: 768px) {
.contact-container {
margin: 20px;
}
.contact-form {
padding: 25px;
}
.contact-header {
padding: 20px;
}
.contact-header h1 {
font-size: 24px;
}
}
document.getElementById('contactForm').addEventListener('submit', function(e) {
e.preventDefault();
// Form validation
const name = document.getElementById('name').value;
const email = document.getElementById('email').value;
const subject = document.getElementById('subject').value;
const message = document.getElementById('message').value;
if (!name || !email || !subject || !message) {
alert('Please fill in all required fields');
return;
}
// Validate email format
const emailPattern = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
if (!emailPattern.test(email)) {
alert('Please enter a valid email address');
return;
}
// Show success message
document.getElementById('successMessage').style.display = 'block';
// In a real application, you would add code here to submit the form to your server
// For example using Fetch API or XMLHttpRequest
// Reset form
setTimeout(() => {
this.reset();
document.getElementById('successMessage').style.display = 'none';
}, 3000);
});