/* --- 1. GLOBAL THEME & RESET --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    /* Moss Green to Deep Wood Brown Gradient */
    background: linear-gradient(135deg, #3e2723 0%, #2d5a27 100%) !important;
    background-attachment: fixed;
    min-height: 100vh;
    color: #333;
}

/* --- 2. HEADER & NAVIGATION --- */
header {
    background: #ffffff;
    padding: 1rem 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    color: #2d5a27;
    font-size: 1.8rem;
    font-weight: bold;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: #5d4037;
    font-weight: 600;
    transition: color 0.3s;
}

nav a:hover, nav a.active {
    color: #2d5a27;
    border-bottom: 2px solid #2d5a27;
}

.logout-btn {
    background: #2d5a27;
    color: white;
    border: none;
    padding: 8px 18px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
}

/* --- 3. COMMON LAYOUT (Used by Home, Estimates, Contact) --- */
.main-content {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 0 2rem;
}

.content-box {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.hero-section {
    text-align: center;
    padding-bottom: 2rem;
    color: #3e2723;
}

/* --- 4. HOME PAGE: SERVICE CARDS & IMAGES --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

.service-card {
    background: #fdf5e6; /* Cream contrast */
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
}

.service-card:hover { transform: translateY(-8px); }

/* Assigning background images via CSS classes as per your Home view */
.service-card::before {
    content: "";
    height: 180px;
    width: 100%;
    background-size: cover;
    background-position: center;
    display: block;
}

.lawn-card::before { background-image: url('images/lawncare.avif'); }
.mulch-card::before { background-image: url('images/mulch&plants.jpg'); }
.snow-card::before { background-image: url('images/snow_removal.jpg'); }
.rock-card::before { background-image: url('images/rock&gravel.jpg'); }
.tree-card::before { background-image: url('images/tree_service.jpg'); }
.estimate-card::before { background-image: url('images/estimates.jpg'); }

.service-card h3 { padding: 1.5rem 1rem 0.5rem; color: #3e2723; text-align: center; }
.service-card p { padding: 0 1.5rem 1.5rem; color: #5d4037; text-align: center; font-size: 0.95rem; line-height: 1.5; }

/* --- 5. ESTIMATES & CONTACT FORMS --- */
.form-group {
    margin-bottom: 1.5rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #5d4037;
}

input, select, textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #d7ccc8;
    border-radius: 8px;
    font-size: 1rem;
    background: #fff;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #2d5a27;
}

/* Estimates Total Display */
.total-display {
    background: #f1f8e9;
    padding: 1.5rem;
    border-radius: 10px;
    margin: 1.5rem 0;
    text-align: center;
    border: 1px solid #dcedc8;
}

.total-amount {
    color: #2d5a27;
    font-size: 2.5rem;
    font-weight: bold;
}

/* --- 6. BUTTONS (Integrated for all pages) --- */
.button-group {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    justify-content: center;
}

.button-group button, .btn-primary, .btn-secondary {
    padding: 12px 20px;
    border-radius: 8px;
    border: none;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: opacity 0.3s;
}

/* Estimates Page Specific Buttons */
.btn-clear { background: #a52a2a; color: white; }
.btn-save { background: #2d5a27; color: white; }
.btn-discard { background: #6d4c41; color: white; }
.btn-load { background: #efebe9; color: #3e2723; border: 1px solid #d7ccc8 !important; }

/* Contact Us Submit Button */
.btn-submit { background: #2d5a27; color: white; width: 100%; }

/* --- 7. LOGIN PAGE SPECIFIC (No Stretch Fix) --- */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 100px);
}

.login-box {
    background: #fdf5e6;
    padding: 3rem;
    border-radius: 15px;
    width: 100%;
    max-width: 400px; /* CRITICAL: Prevents stretching seen in previous versions */
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.btn-primary { background: #2d5a27; color: white; width: 100%; margin-bottom: 10px; }
.btn-secondary { background: #8b5a2b; color: white; width: 100%; }

/* Error/Success Messages */
.error-message { background: #ffebee; color: #c62828; padding: 10px; border-radius: 5px; margin-bottom: 1rem; }
.success-message { background: #e8f5e9; color: #2e7d32; padding: 10px; border-radius: 5px; margin-bottom: 1rem; }

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}