/*
 * Modern Career Form Style
 * Design: Minimalist, Responsive, User-Friendly
 * Date: August 5, 2025
 */

/* --- Google Font Import --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

/* --- CSS Custom Properties (Variables) --- */
:root {
    --font-family-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    
    --color-bg: #F9FAFB; /* Very light gray page background */
    --color-surface: #FFFFFF; /* Form background */
    --color-text-primary: #111827; /* For headings and input text */
    --color-text-secondary: #4B5563; /* For labels and secondary text */
    --color-border: #D1D5DB; /* Default border */
    --color-border-focus: #3B82F6; /* Accent color for focus states */
    --color-accent: #2563EB; /* Primary button and accent color */
    --color-accent-hover: #1D4ED8; /* Darker accent for hover */
    --color-required: #DC2626; /* For the required asterisk */

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --ring-offset-shadow: 0 0 #0000;
    --ring-shadow: 0 0 0 3px hsla(217, 91%, 60%, 0.2);
}

/* --- Base & Reset Styles --- */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Apply a background color to the page body for context */
body {
    background-color: var(--color-bg);
    font-family: var(--font-family-sans);
    color: var(--color-text-primary);
    line-height: 1.6;
}

/* --- Main Form Container --- */
.career-form {
    background-color: var(--color-surface);
    max-width: 800px;
    margin: 3rem auto;
    padding: 2.5rem;
    border-radius: 12px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--color-border);
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two-column layout */
    gap: 1.25rem 2rem; /* Row and column gap */
}

/* --- Typography & Section Headers --- */
.career-form h2 {
    grid-column: 1 / -1; /* Span full width */
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0 0 0.5rem 0;
    color: var(--color-text-primary);
}

.career-form h3 {
    grid-column: 1 / -1; /* Span full width */
    font-size: 1.125rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-text-primary);
}

.career-form .required-note {
    grid-column: 1 / -1; /* Span full width */
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--color-text-secondary);
}

.career-form .required-note span {
    color: var(--color-required);
    font-weight: 600;
}


/* --- Form Groups & Layout Control --- */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* Make specific fields span the full width of the grid */
.form-group:has(input[name="address1"]),
.form-group:has(input[name="address2"]),
.form-group:has(input[name="availability"]),
.form-group:has(textarea) {
    grid-column: 1 / -1;
}


/* --- Labels & Inputs --- */
.form-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-secondary);
}

/* Common styles for all form controls */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--color-text-primary);
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Focus styles for a modern, accessible feel */
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--color-border-focus);
    box-shadow: var(--ring-offset-shadow), var(--ring-shadow), var(--shadow-sm);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

/* Custom styling for the select dropdown arrow */
select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

/* --- Special Section Styling: References --- */
/* The HTML for references has multiple fields in one group. This CSS handles it. */
.form-group:has(input[name^="ref_"]) {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Name and Phone side-by-side */
    gap: 1rem;
    align-items: end; /* Aligns the inputs at the bottom */
}

.form-group:has(input[name^="ref_"]) label {
    margin-bottom: -0.25rem; /* Tweak spacing */
}


/* --- Submit Button --- */
/* --- Submit Button --- */
.submit-btn {
    grid-column: 1 / -1; /* Span full width */
    justify-self: center; /* <<< THIS LINE WAS CHANGED from 'end' to 'center' */
    
    background-color: var(--color-accent);
    color: #FFFFFF;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.1s ease;
    margin-top: 1.5rem;
}

.submit-btn:hover {
    background-color: var(--color-accent-hover);
}

.submit-btn:active {
    transform: scale(0.98);
}

.submit-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}


/* --- Responsive Design --- */
@media (max-width: 768px) {
    .career-form {
        /* Switch to a single-column layout on smaller screens */
        grid-template-columns: 1fr;
        padding: 2rem;
        margin: 2rem auto;
    }

    /* Make the reference fields stack vertically on mobile */
    .form-group:has(input[name^="ref_"]) {
        grid-template-columns: 1fr;
    }

    .submit-btn {
        justify-self: stretch; /* Make button full width on mobile */
        width: 100%;
    }
}