/*
 * Custom styles for MyWebApp
 * -----------------------------------------------------------
 * This stylesheet replaces Tailwind CSS and implements all styling
 * including custom colors, responsiveness, and component styles.
 *
 * FIX: Increased CSS selector specificity by targeting the new '.form-input-field' class
 * injected via the forms.py widgets. This is the final, most reliable fix for padding issues.
 * ENHANCEMENT: Added styles for the two-column form grid (.form-grid-2) and the contact info section.
 * FIX 2: Explicitly set text color and increased message box height.
 */

:root {
    /* Custom Color Palette based on #432689 */
    --primary-color: #0D47A1;
    --primary-light: #0D47A1;
    --secondary-color: #e9e3f6;
    --text-color: #374151; /* gray-700 */
    --background-light: #f3f4f6; /* gray-100 */
    --light-gray: #6b7280; /* A slightly lighter gray for descriptions */
    --dark-text: #1f2937; /* Used for headings, gray-900 equivalent */
    --primary-text-contrast: #ffffff;
}

/* Global Reset and Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--background-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text-color);
    line-height: 1.5;
}

/* Container for Centering and Padding */
.container {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Small screens (sm:px-6) */
@media (min-width: 640px) {
    .container {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
}

/* Large screens (lg:px-8) */
@media (min-width: 1024px) {
    .container {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

/* --- Header Styling --- */
.app-header {
    background-color: #fff;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1); /* shadow-lg */
    position: sticky;
    top: 0;
    z-index: 10;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.app-logo {
    font-size: 1.875rem; /* text-3xl */
    font-weight: 800; /* font-extrabold */
    color: var(--primary-color);
    letter-spacing: -0.05em; /* tracking-tight */
    transition: opacity 0.2s ease-in-out;
}

.app-logo:hover {
    opacity: 0.9;
}

.app-nav {
    display: flex;
    align-items: center;
    gap: 1rem; /* space-x-4 */
}

.nav-link {
    color: var(--text-color);
    font-weight: 500; /* font-medium */
    transition: color 0.2s ease-in-out;
    text-decoration: none;
}

.nav-link:hover {
    color: var(--primary-light);
}

/* Responsive navigation links (hidden md:inline) */
.nav-link-desktop {
    display: none;
}

@media (min-width: 768px) { /* md breakpoint */
    .nav-link-desktop {
        display: inline;
    }
}

/* --- Main Content Styling --- */
.app-main {
    flex-grow: 1; /* flex-grow */
    padding-top: 2rem;
    padding-bottom: 2rem;
}

@media (min-width: 768px) {
    .app-main {
        padding-top: 3rem; /* md:py-12 */
        padding-bottom: 3rem;
    }
}

/* Messages */
.message-container {
    margin-bottom: 1.5rem;
    max-width: 42rem; /* max-w-4xl */
    margin-left: auto;
    margin-right: auto;
}

.message-box {
    padding: 1rem;
    border-radius: 0.75rem; /* rounded-xl */
    font-size: 0.875rem; /* text-sm */
    margin-bottom: 0.5rem;
    font-weight: 600; /* font-semibold */
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1); /* shadow-md */
    border-width: 1px;
}

.message-success {
    background-color: #d1fae5; /* bg-green-100 */
    color: #065f46; /* text-green-800 */
    border-color: #a7f3d0; /* border-green-300 */
}
.message-error {
    background-color: #fee2e2; /* bg-red-100 */
    color: #991b1b; /* text-red-800 */
    border-color: #fca5a5; /* border-red-300 */
}
.message-info {
    background-color: #dbeafe; /* bg-blue-100 */
    color: #1e40af; /* text-blue-800 */
    border-color: #93c5fd; /* border-blue-300 */
}


/* --- Footer Styling --- */
.app-footer {
    background-color: var(--primary-color);
    color: #fff;
    margin-top: auto;
    box-shadow: inset 0 2px 4px 0 rgba(0, 0, 0, 0.06); /* shadow-inner */
}

.footer-content {
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    text-align: center;
    font-size: 0.875rem;
}

.footer-links {
    margin-top: 0.75rem;
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-link {
    color: #fff;
    text-decoration: none;
    transition: color 0.2s ease-in-out;
}

.footer-link:hover {
    color: var(--secondary-color);
}

/* --- Input Focus Styling (ENHANCED) --- */

/* TARGETING NEW CLASS: This ensures the styles are applied directly to the form input elements */
.form-input-field {
    transition: all 0.2s ease-in-out !important;
    border-color: #d1d5db !important;
    border-width: 1px !important;
    border-radius: 0.5rem !important;
    /* ENHANCEMENT: Added subtle inset shadow for a recessed, modern look */
    box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.08) !important; 
    /* FINAL PADDING FIX: 1rem vertical padding guaranteed to work now */
    padding: 1rem 1.25rem !important; 
    width: 100%; /* Ensure fields take full width */
    font-size: 1rem; /* Standard font size */
    color: var(--dark-text) !important; /* FIX: Explicitly set text color for contrast */
}

/* Specific adjustment for textarea height - also targeting the class */
.form-input-field[name='message'] {
    min-height: 10rem !important; /* ENHANCEMENT: Increased minimum height */
    resize: vertical; 
}


/* Focus styles for high specificity on the new class */
.form-input-field:focus {
    border-color: var(--primary-color) !important;
    /* Using a direct rgba of primary-color for focus ring, while keeping inset shadow */
    box-shadow: inset 0 1px 3px 0 rgba(0, 0, 0, 0.08), 0 0 0 3px rgba(13, 71, 161, 0.4) !important; 
    background-color: #ffffff !important;
    outline: none !important;
}

/* Fallback for fields not explicitly tagged with form-input-field (e.g., if a field type was missed) */
.form-group input,
.form-group textarea {
    /* Merely applies if the above class targeting fails for some reason */
    box-sizing: border-box !important;
    width: 100% !important;
}

/* --- Contact Page Specific Styling (COMPACT SINGLE-COLUMN LAYOUT) --- */

/* Main Container for the entire Contact Section */
.form-card {
    max-width: 36rem; 
    margin-left: auto;
    margin-right: auto;
    background-color: #fff;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1); 
    border-radius: 0.75rem;
    padding: 2.5rem; 
    margin-top: 2rem;
    margin-bottom: 2rem;
}

@media (min-width: 640px) { /* sm breakpoint */
    .form-card {
        padding: 3rem; 
    }
}


/* Form Headings */
.form-title {
    font-size: 2rem; 
    font-weight: 700;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
    text-align: center;
}

.form-description {
    color: var(--light-gray);
    margin-bottom: 2rem;
    text-align: center;
    font-size: 1rem;
}

/* Form Body */
.form-body {
    display: flex;
    flex-direction: column;
    gap: 1.25rem; 
}

/* Form Group (Label and Field wrapper) */
.form-group {
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.875rem; 
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 0.375rem; 
}

.required-star {
    color: #ef4444;
}

/* Error Message */
.form-error-message {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    color: #dc2626;
}

/* Submit Button */
.form-submit-button {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border: none;
    width: 100%;
    display: flex;
    justify-content: center;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    font-size: 1.125rem;
    font-weight: 600;
    color: #fff;
    background-color: var(--primary-color);
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}

.form-submit-button:hover {
    background-color: var(--primary-light);
    box-shadow: 0 6px 8px -2px rgba(0, 0, 0, 0.15); /* slight lift */
}

.form-submit-button:focus {
    outline: none;
    box-shadow: 0 0 0 4px rgba(13, 71, 161, 0.4);
}

/* NEW: Grid for two-column fields (Name and Email) */
.form-grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.25rem;
}

@media (min-width: 640px) {
    .form-grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* NEW: Contact Info Section (Other Ways to Connect) */
.contact-info-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid #e5e7eb;
    text-align: center;
}

.contact-info-section h3 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--dark-text);
    margin-bottom: 0.5rem;
}

.contact-info-section p {
    color: var(--light-gray);
    margin-bottom: 1rem;
}

.info-link {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
    font-size: 1.125rem;
    display: block;
}

.info-link:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

/* --- Home Page Hero Section (Supporting home.html) --- */
.hero-section {
    text-align: center;
    padding: 4rem 1rem; 
    background-color: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); 
    border-radius: 0.75rem; 
}

.hero-title {
    font-size: 3rem; 
    line-height: 1;
    font-weight: 800; 
    color: var(--dark-text);
    margin-bottom: 1rem;
}
@media (min-width: 640px) {
    .hero-title {
        font-size: 4rem; 
    }
}

.hero-subtitle {
    font-size: 1.25rem; 
    color: var(--light-gray);
    margin-bottom: 2rem;
    max-width: 42rem; 
    margin-left: auto;
    margin-right: auto;
}

/* --- Legal Document Styling (Supporting legal.html) --- */
.legal-document {
    max-width: 64rem; 
    margin-left: auto;
    margin-right: auto;
    background-color: #fff;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04); 
    border-radius: 0.75rem; 
    padding: 2rem; 
    margin-top: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) { /* sm breakpoint */
    .legal-document {
        padding: 2.5rem; 
    }
}

@media (min-width: 1024px) { /* lg breakpoint */
    .legal-document {
        padding: 3rem; 
    }
}

.legal-title {
    font-size: 2.25rem; 
    font-weight: 700; 
    color: var(--dark-text);
    margin-bottom: 1.5rem;
    border-bottom: 1px solid #d1d5db;
    padding-bottom: 0.75rem; 
}

.legal-content {
    color: var(--text-color); 
    line-height: 1.75; 
}

/* Convert Tailwind's space-y-4 class to standard margin-bottom on child elements */
.legal-content > p {
    margin-bottom: 1rem; 
}
