/* ==========================================================================
   0. CSS Variables (Theme Colors)
   ========================================================================== */
/* Theme 1: Coastal & Calm (Default) */
:root {
    --primary-text: #343A40;      /* Charcoal */
    --secondary-bg: #EAE0D5;      /* Sandstone */
    --accent-color: #F7941D;      /* Sunset Orange */
    --neutral-white: #FFFFFF;     /* White */
    --border-color: #d8cec5;      /* A slightly darker sandstone for borders */
    --link-color:   #005A9C;      /* Coastal Blue */
}

/* Theme 2: Modern & Minimalist */
[data-theme="minimalist"] {
    --primary-text: #212529;      /* Charcoal */
    --secondary-bg: #F1F3F5;      /* Light Grey */
    --accent-color: #FF6B6B;      /* Vibrant Orange/Coral */
    --neutral-white: #FFFFFF;     /* White */
    --border-color: #dee2e6;      /* A slightly darker grey for borders */
    --link-color:   #212529;      /* Charcoal for links */
}

/* Theme 3: Forest & Clay */
[data-theme="forest"] {
    --primary-text: #3d403a;      /* Dark Moss */
    --secondary-bg: #f4f1ea;      /* Cream */
    --accent-color: #c87e66;      /* Terracotta Clay */
    --neutral-white: #FFFFFF;     /* White */
    --border-color: #e0ddd5;      /* A slightly darker cream */
    --link-color:   #0d6b4f;      /* Deep Forest Green */
}

/* Theme 4: Elegant Teal */
[data-theme="elegant"] {
    --primary-text: #2c3e50;
    --secondary-bg: #ecf0f1;
    --accent-color: #1abc9c;
    --neutral-white: #FFFFFF;
    --border-color: #bdc3c7;
    --link-color:   #2980b9;
}

/* Theme 5: Vibrant Blue */
[data-theme="vibrant"] {
    --primary-text: #212529;
    --secondary-bg: #FFFFFF;
    --accent-color: #4285F4;
    --neutral-white: #FFFFFF;
    --border-color: #dee2e6;
    --link-color:   #4285F4;
}

/* Theme 6: Energetic Orange */
[data-theme="orange"] {
    --primary-text: #212529;
    --secondary-bg: #f8f9fa;
    --accent-color: #f04b24;
    --neutral-white: #FFFFFF;
    --border-color: #dee2e6;
    --link-color:   #212529;
}

/* ==========================================================================
   1. Base Styles & Typography
   ========================================================================== */
* {
    box-sizing: border-box;
}

body {
    background-color: var(--secondary-bg);
    font-family: 'Lato', sans-serif;
    color: var(--primary-text);
    margin: 0;
    padding: 20px;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', sans-serif;
    color: var(--link-color); /* Use Coastal Blue for all headings */
}

/* ==========================================================================
   2. Layout Styles
   ========================================================================== */
 .container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
    padding: 0 20px;
}

.section-container {
    padding: 80px 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.split-layout {
    display: flex;
    flex-direction: column; /* Mobile first: stack */
    gap: 30px;
    padding: 40px 0;
}

.split-layout-content h2 {
    margin-top: 0;
}

.split-layout-form .contact-form {
    background-color: var(--secondary-bg);
    padding: 25px;
    border-radius: 8px;
}

.home-section {
    padding: 60px 0;
}

/* ==========================================================================
   3. Component Styles
   ========================================================================== */

/* Buttons*/
.button {
    background-color: var(--accent-color);
    color: var(--neutral-white);
    padding: 12px 25px;
    border: none;
    border-radius: 8px;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    text-decoration: none;
    display: inline-block;
}

.button:hover {
    opacity: 0.85;
}

.button-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.button-large {
    padding: 15px 30px;
    font-size: 1.1rem;
}

.button-outline {
    background: transparent;
    border: 2px solid var(--neutral-white);
    color: var(--neutral-white);
}

.button-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--neutral-white);
}

/* Cards */
.card {
    background-color: var(--neutral-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden; /* Important for keeping child corners rounded */
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out, background-color 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-grid {
    display: grid;
    gap: 25px;
    padding: 0;
    list-style: none;
    /* Mobile First: Default to 1 column */
    grid-template-columns: 1fr;
}

/* Messages */
.message {
    padding: 15px;
    margin-bottom: 10px;
    border-radius: 8px;
    font-weight: 500;
}

.messages {
    list-style: none;
    padding: 0;
    margin: 0 0 20px 0;
}

.messages-wrapper {
    padding-top: 20px;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Modals */
.modal-content {
    background-color: var(--neutral-white);
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
}

.modal-overlay {
    display: none; /* Hidden by default */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-overlay.is-visible {
    display: flex; /* Show the modal */
}

.cta-section {
    background-color: var(--secondary-bg);
    padding: 40px;
    border-radius: 8px;
    text-align: center;
}

.cta-section h2 {
    margin-top: 0;
}

.primaryAction {
    /* Matches .button style, usually handled by class="button primaryAction" */
    width: 100%;
}

#back-to-top-btn {
    display: none; /* Hidden by default */
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99;
    border: none;
    outline: none;
    background-color: var(--accent-color);
    color: white;
    cursor: pointer;
    padding: 0;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 24px;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    visibility: hidden;
}

#back-to-top-btn.visible {
    display: block;
    opacity: 1;
    visibility: visible;
}

.main-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
	padding: 15px 0;
}

/* ==========================================================================
   4. Form Styles
   ========================================================================== */

/* Contact Form */
.contact-form {
    background-color: var(--secondary-bg);
    padding: 25px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.contact-form .errorlist {
    list-style-type: none;
    padding: 0;
    margin: 5px 0 0 0;
    font-size: 0.9rem;
    font-weight: bold;
    color: #c71e1e; /* A strong, clear red */
}

/* Auth */
.auth-container {
    padding: 40px 20px;
    max-width: 600px;
    margin: 0 auto; /* Ensures it is centered horizontally */
}

.auth-link-wrapper {
    margin-top: 15px;
    text-align: center;
}

/* Submit */
.form-submit-full {
    width: 100%;
}

.error-page-container {
    max-width: 600px;
    margin: 80px auto;
    text-align: center;
    padding: 0 20px;
}

.error-icon {
    font-size: 4rem;
    margin-bottom: 20px;
    display: block;
}

.error-title {
    font-size: 2rem;
    margin-bottom: 16px;
    color: var(--header-color, #1f2937);
    font-weight: 700;
}

.error-text {
    color: var(--text-muted, #6b7280);
    font-size: 1.1rem;
    margin-bottom: 30px;
    line-height: 1.6;
}

.error-exception-box {
    background: #fee2e2;
    color: #991b1b;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 30px;
    display: inline-block;
    font-family: monospace;
    font-size: 0.9em;
}

.error-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.auth-reset-link {
    display: block;
    margin-top: 12px;
    font-size: 0.9em;
    color: var(--link-color);
    text-decoration: underline;
    cursor: pointer;
}

.auth-reset-link:hover {
    opacity: 0.8;
}

/* ==========================================================================
   5. Media Queries / Responsive Design
   ========================================================================== */
@media (min-width: 768px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .split-layout {
        flex-direction: row;
        gap: 50px;
    }
    .split-layout-content {
        flex: 6; /* Content takes ~60% */
    }
    .split-layout-form {
        flex: 4; /* Form takes ~40% */
    }

    /* --- Contact Form Styles --- */
    .contact-form p {
        margin-bottom: 20px;
    }

    .contact-form label {
        display: block;
        margin-bottom: 5px;
        font-weight: 600;
        color: var(--primary-text);
    }

    .contact-form input,
    .contact-form textarea {
        width: 100%;
        padding: 12px;
        border: 1px solid var(--border-color);
        border-radius: 4px;
        font-size: 1rem;
        font-family: 'Lato', sans-serif;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .contact-form input:focus,
    .contact-form textarea:focus {
        outline: none;
        border-color: var(--link-color);
        box-shadow: 0 0 0 3px color-mix(in srgb, var(--link-color) 20%, transparent);
    }

    .contact-form button {
        width: 100%;
        padding: 12px;
        font-size: 1rem;
    }
}

@media (min-width: 1200px) {
    .card-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}