/* ==========================================================================
   Design Tokens & Visual Properties
   ========================================================================== */

:root {
    --core-dark: #0a2540;          /* Deep Midnight Blue */
    --core-muted: #505a5f;         /* Content text grey */
    --core-surface: #f8fafc;       /* Structural background accent */
    --core-line: #d2d5d9;          /* Separation rules */
    --action-primary: #0a2540;     /* Primary button default */
    --action-hover: #001020;       /* Primary button dynamic state */
    --utility-highlight: #ffdd00;  /* Accessibility focus ring */
    --feedback-error-line: #00a3c4; /* Prominent left border accent */
    --feedback-error-text: #007a99; /* High-contrast accessible text */
}

/* Base resets & typography */
body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    background-color: var(--core-surface);
    color: var(--core-dark);
    line-height: 1.5;
    margin: 0;
    padding: 2rem;
}

/* Page Header Styling */
h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 2rem;
    padding-bottom: 0.5rem;
    border-bottom: 4px solid var(--core-dark);
}

/* ==========================================================================
   Two-Column Grid Layout
   ========================================================================== */
.dashboard-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 3rem;
}

section {
    flex: 1;
    min-width: 300px;
}

/* ==========================================================================
   Accessible Form Controls
   ========================================================================== */
form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Force label text to sit clearly above inputs */
label {
    display: flex;
    flex-direction: column;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--core-dark);
    gap: 0.5rem;
}

/* Inputs & Dropdowns */
textarea[name="description"], 
select {
    font-family: inherit;
    font-size: 1.125rem;
    height: 2.75rem;
    padding: 0.25rem 0.5rem;
    border: 2px solid var(--core-dark);
    background-color: #ffffff;
    box-sizing: border-box;
    max-width: 100%;
}

/* Universal Focus States for Accessibility */
textarea[name="description"]:focus,
select:focus,
button:focus {
    outline: 3px solid var(--utility-highlight);
    outline-offset: 0;
    box-shadow: inset 0 0 0 2px var(--core-dark);
}

/* Call-to-Action Primary Button */
button[type="submit"] {
    font-family: inherit;
    font-size: 1.15rem;
    font-weight: 500;
    color: #ffffff;
    background-color: var(--action-primary);
    border: none;
    border-bottom: 3px solid #000000;
    padding: 0.6rem 1.2rem;
    cursor: pointer;
    align-self: flex-start;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

button[type="submit"]:hover {
    background-color: var(--action-hover);
}

button[type="submit"]:active {
    position: relative;
    top: 2px;
    border-bottom-width: 1px;
}

/* ==========================================================================
   Tabular Data Systems
   ========================================================================== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 0.5rem;
}

th, td {
    padding: 0.75rem 1rem 0.75rem 0;
    text-align: left;
    border-bottom: 1px solid var(--core-line);
    font-size: 1rem;
}

th {
    font-weight: 700;
    border-bottom: 3px solid var(--core-dark);
}

td {
    color: var(--core-dark);
}

/* Empty State / Status paragraphs */
p {
    font-size: 1.15rem;
    color: var(--core-muted);
    margin-top: 0;
}

/* ==========================================================================
    Alert System
   ========================================================================== */

/* Triggers the 5px GDS left-border on the parent section */
.form-group--error {
    padding-left: 15px;
    border-left: 5px solid var(--feedback-error-line);
}

/* Bold, accessible inline error heading */
.error-message {
    font-weight: 700;
    font-size: 1.1875rem;
    display: block;
    margin-bottom: 1rem;
    color: var(--feedback-error-text);
}

/* Screen-reader utility prefix */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}