@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    src: url('../fonts/Atkinson Hyperlegible Next_Final/Atkinson Hyperlegible Next/AtkinsonHyperlegibleNext-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Atkinson Hyperlegible Next';
    src: url('../fonts/Atkinson Hyperlegible Next_Final/Atkinson Hyperlegible Next/AtkinsonHyperlegibleNext-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Atkinson Hyperlegible Next', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #333;
}

nav {
    background-color: #424344;
    color: white;
    position: sticky;
    top: 0;
    z-index: 50;
}

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

nav .logo {
    font-size: 1.5rem;
    font-weight: bold;
}

nav .logo img {
    height: 40px;
    width: auto;
}

nav .links {
    display: flex;
    gap: 1.5rem;
    list-style: none;
}

nav a {
    color: white;
    text-decoration: none;
    transition: opacity 0.3s;
}

nav a:hover {
    opacity: 0.8;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Mobile Navigation */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.5rem;
}

.nav-toggle:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

section {
    padding: 4rem 1rem;
}

section h1 {
    font-size: 2.25rem;
    text-align: center;
    margin-bottom: 3rem;
    color: #2f4668;
}

.form-container {
    background: white;
    padding: 2rem;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 900px;
    margin: 0 auto;
}

/* Highlighted instruction section */
.form-container h3:last-of-type {
    background-color: #e8f4fd;
    padding: 1.5rem;
    border-radius: 0.375rem;
    border-left: 4px solid #2f4668;
    margin: 2rem 0;
    font-weight: 600;
    color: #2f4668;
}

.form-section {
    margin-bottom: 2rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row.full {
    grid-template-columns: 1fr;
}

.form-group {
    display: flex;
    flex-direction: column;
}

label {
    font-weight: 600;
    color: #333;
    margin-bottom: 0.5rem;
    font-size: 14px;
}

.required::after {
    content: " *";
    color: #dc3545;
}

input[type="text"],
input[type="date"],
input[type="number"],
select {
    padding: 0.625rem 0.75rem;
    border: 1px solid #ddd;
    border-radius: 0.375rem;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus,
select:focus {
    outline: none;
    border-color: #2f4668;
    box-shadow: 0 0 5px rgba(47, 70, 104, 0.1);
}

.items-section {
    margin-top: 2rem;
}

.items-section h2 {
    color: #2f4668;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #2f4668;
    padding-bottom: 0.75rem;
}

.item-entry {
    background: #f9fafb;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
    border-left: 4px solid #2f4668;
}

.item-row {
    display: grid;
    grid-template-columns: 80px 1fr 150px 150px 80px;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    align-items: flex-end;
}

.item-row input[type="number"] {
    width: 100%;
}

.remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.3s;
}

.remove-btn:hover {
    background: #c82333;
}

.add-item-btn {
    background: #2f4668;
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.3s;
    margin-top: 1rem;
}

.add-item-btn:hover {
    opacity: 0.9;
}

.total-section {
    margin-top: 2rem;
    text-align: right;
    font-size: 1.125rem;
    font-weight: bold;
    padding-top: 1.5rem;
    border-top: 2px solid #ddd;
}

.total-amount {
    color: #2f4668;
    font-size: 1.5rem;
}

.button-group {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-top: 2rem;
}

.form-btn {
    padding: 0.75rem 2rem;
    border: none;
    border-radius: 0.375rem;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: opacity 0.3s;
    background: #2f4668;
    color: white;
}

.form-btn:hover {
    opacity: 0.9;
}

.error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 0.35rem;
}

/* Link Styles */
a {
    color: #2563eb;
    text-decoration: none;
    transition: all 0.3s ease;
    font-weight: 500;
}

a:hover {
    color: #1d4ed8;
    text-decoration: underline;
}

a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
    border-radius: 2px;
}

.bg-light {
    background-color: #f9fafb;
}

.reimburse-divider {
    width: 40px;
    border: 0;
    height: 2px;
    background: rgba(0, 0, 0, 0.7);
    margin: 0.75rem auto;
    border-radius: 1px;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    nav .container {
        padding: 0.75rem;
    }
    
    nav .logo {
        font-size: 1.25rem;
    }
    
    nav .logo img {
        height: 32px;
    }
    
    nav .links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background-color: #424344;
        flex-direction: column;
        gap: 0;
        padding: 1rem 0;
        transform: translateY(-100%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    nav .links.active {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }
    
    nav .links li {
        width: 100%;
        text-align: center;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    nav .links li:last-child {
        border-bottom: none;
    }
    
    nav .links a {
        display: block;
        padding: 1rem;
        width: 100%;
    }
    
    .nav-toggle {
        display: block;
    }
    
    section {
        padding: 2rem 1rem;
    }
    
    section h1 {
        font-size: 1.875rem;
        margin-bottom: 2rem;
    }
    
    .form-container {
        padding: 1.5rem;
        margin: 0 0.5rem;
    }
    
    .form-row {
        grid-template-columns: 1fr; /* Stack fields vertically on mobile */
        gap: 1rem;
        margin-bottom: 1rem;
    }
    
    .item-row {
        grid-template-columns: 1fr; /* Stack all item fields vertically */
        gap: 0.75rem;
        margin-bottom: 1rem;
    }
    
    .item-row input[type="number"] {
        width: 100%;
    }
    
    .item-entry {
        padding: 0.75rem;
    }
    
    .items-section h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    .total-section {
        text-align: center; /* Center total on mobile */
        margin-top: 1.5rem;
        padding-top: 1rem;
    }
    
    .total-amount {
        font-size: 1.25rem;
    }
    
    .button-group {
        flex-direction: column;
        gap: 0.5rem;
        align-items: center;
    }
    
    .form-btn,
    .add-item-btn {
        width: 100%;
        max-width: 300px;
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .remove-btn {
        width: 100%;
        margin-top: 0.5rem;
    }
    
    /* Make inputs touch-friendly */
    input[type="text"],
    input[type="date"],
    input[type="number"],
    select {
        padding: 0.75rem;
        font-size: 16px; /* Prevent zoom on iOS */
        min-height: 44px; /* Touch target size */
    }
    
    label {
        font-size: 16px;
        margin-bottom: 0.375rem;
    }
}

@media (max-width: 480px) {
    nav .links {
        gap: 0.75rem;
        font-size: 14px;
    }
    
    .form-container {
        padding: 1rem;
        margin: 0 0.25rem;
    }
    
    section h1 {
        font-size: 1.5rem;
        margin-bottom: 1.5rem;
    }
    
    .item-entry {
        padding: 0.5rem;
        margin-bottom: 0.75rem;
    }
    
    .items-section h2 {
        font-size: 1.125rem;
    }
}
