/* Brand foundation */
@font-face {
    font-family: 'APC';
    font-style: normal;
    font-weight: 200;
    font-display: swap;
    src: url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Light.woff2') format('woff2'),
         url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Light.woff') format('woff');
}

@font-face {
    font-family: 'APC';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Reg.woff2') format('woff2'),
         url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Reg.woff') format('woff');
}

@font-face {
    font-family: 'APC';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Med.woff2') format('woff2'),
         url('https://legionellasampling.co.uk/wp-content/uploads/2024/05/Apc-Med.woff') format('woff');
}

:root {
    --color-primary: #332f2f;
    --color-secondary: #7b64b2;
    --color-accent: #e986a0;
    --color-warm: #ffbc7d;
    --color-ink-soft: #4d4646;
    --color-sand: #f9fafc;
    --radius-md: 12px;
    --shadow-soft: 0 8px 24px rgba(51, 47, 47, 0.08);
    --shadow-card: 0 10px 35px rgba(51, 47, 47, 0.12);
}

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

body {
    font-family: 'APC', 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--color-primary);
    background: var(--color-sand);
}

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

/* Navigation */
.navbar {
    background: var(--color-secondary);
    color: white;
    padding: 1.1rem 0;
    box-shadow: var(--shadow-soft);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.nav-brand a {
    color: white;
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 1.2rem;
    align-items: center;
}

.nav-menu li {
    display: flex;
    align-items: center;
}

.nav-menu a {
    color: white;
    text-decoration: none;
    font-weight: 600;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    transition: background 0.25s ease, opacity 0.25s ease;
    display: flex;
    align-items: center;
}

.nav-menu a:hover {
    background: rgba(255, 255, 255, 0.16);
    opacity: 0.95;
}

/* Navigation Dropdown */
.nav-dropdown {
    position: relative;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    min-width: 180px;
    z-index: 1000;
}

.dropdown-menu a {
    display: block;
    padding: 0.75rem 1rem;
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    border-radius: 0;
}

.dropdown-menu a:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 8px 8px;
}

.dropdown-menu a:hover {
    background: #f8fafc;
    color: #667eea;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2.5rem 0 2rem;
}

.subtitle {
    color: var(--color-ink-soft);
    margin-top: 0.35rem;
}

/* Cards */
.card {
    background: #fff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(51, 47, 47, 0.06);
}

.card-header {
    border-bottom: 2px solid rgba(123, 100, 178, 0.15);
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
}

.card-title {
    font-size: 1.4rem;
    color: var(--color-primary);
}

/* Forms */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--color-primary);
}

.form-control {
    width: 100%;
    padding: 0.85rem 0.9rem;
    border: 1px solid rgba(51, 47, 47, 0.14);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(123, 100, 178, 0.2);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23332f2f' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    padding-right: 2.5rem;
}

textarea.form-control {
    resize: vertical;
    min-height: 110px;
}

#address_compact {
    min-height: 72px;
}

/* Table container for mobile scrolling */
.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.9rem 1.35rem;
    border: none;
    border-radius: 999px;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: rgb(233, 134, 160);
    color: white;
}

.btn-success {
    background: rgb(233, 134, 160);
    color: white;
}

.btn-danger {
    background: rgb(233, 134, 160);
    color: white;
}

.btn-secondary {
    background: white;
    color: rgb(123, 100, 178);
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-soft);
}

.table th,
.table td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(51, 47, 47, 0.08);
}

.table th {
    background: rgba(123, 100, 178, 0.08);
    font-weight: 700;
    color: var(--color-primary);
}

.table tr:hover {
    background: rgba(255, 188, 125, 0.08);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.badge-success {
    background: rgba(123, 100, 178, 0.12);
    color: var(--color-secondary);
}

.badge-warning {
    background: rgba(255, 188, 125, 0.2);
    color: #c06b17;
}

.badge-danger {
    background: rgba(233, 134, 160, 0.18);
    color: #b95572;
}

.badge-info {
    background: rgba(51, 47, 47, 0.08);
    color: var(--color-primary);
}

/* Alerts */
.alert {
    padding: 1rem 1.1rem;
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid transparent;
    box-shadow: var(--shadow-soft);
}

.alert-success {
    background: rgba(123, 100, 178, 0.12);
    color: var(--color-secondary);
    border-color: rgba(123, 100, 178, 0.25);
}

.alert-error {
    background: rgba(233, 134, 160, 0.18);
    color: #b95572;
    border-color: rgba(233, 134, 160, 0.28);
}

.alert-info {
    background: rgba(255, 188, 125, 0.18);
    color: #9f5616;
    border-color: rgba(255, 188, 125, 0.3);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.3rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: #fff;
    padding: 1.4rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    border-left: 6px solid var(--color-secondary);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 40px rgba(123, 100, 178, 0.2);
}

.stat-card h3 {
    color: var(--color-ink-soft);
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.45rem;
}

.stat-card .stat-value {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--color-primary);
}

/* Footer */
.footer {
    background: var(--color-primary);
    color: white;
    padding: 1.6rem 0;
    text-align: center;
    margin-top: auto;
}

/* Auth Pages */
.auth-container {
    max-width: 420px;
    margin: 4rem auto;
}

.auth-card {
    background: white;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-card);
    padding: 2.1rem;
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-header h1 {
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar .container {
        flex-direction: column;
        gap: 0.8rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(51, 47, 47, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 999;
}

.modal.active {
    display: flex;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(51, 47, 47, 0.48);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    z-index: 10000;
}

.modal-card {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(51, 47, 47, 0.22);
    max-width: 820px;
    width: 100%;
    padding: 1.75rem;
    position: relative;
}

.modal-content {
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(51, 47, 47, 0.22);
    max-width: 500px;
    width: 100%;
    padding: 1.75rem;
    position: relative;
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.modal-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}

.modal-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.8rem;
    color: var(--color-ink-soft);
    margin-bottom: 0.1rem;
}

.modal-close {
    position: absolute;
    top: 10px;
    right: 10px;
    border: none;
    background: transparent;
    color: var(--color-primary);
    font-size: 1.6rem;
    line-height: 1;
    padding: 4px 6px;
    cursor: pointer;
}

.modal-close:hover {
    color: var(--color-secondary);
}

.stepper {
    display: flex;
    gap: 0.75rem;
    margin: 0.75rem 0 1.5rem;
}

.modal-header .stepper {
    margin: 0;
}

.step-dot {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(51, 47, 47, 0.1);
    color: var(--color-primary);
    display: grid;
    place-items: center;
    font-weight: 700;
}

.step-dot.active {
    background: var(--color-secondary);
    color: #fff;
}

.step-dot.done {
    background: var(--color-warm);
    color: var(--color-primary);
}

.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

body.modal-open {
    overflow: hidden;
}

/* Three-column form row on desktop for contact fields */
.form-row-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

@media (min-width: 992px) {
    .form-row-3 {
        grid-template-columns: repeat(3, 1fr);
        gap: 1rem;
    }
}

/* Two-column row for name + phone; email on its own line */
.form-row-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

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


.address-results {
    margin-top: 0.3rem;
    display: none;
    max-height: 140px;
    overflow: auto;
    border: 1px solid rgba(51, 47, 47, 0.12);
    border-radius: 10px;
    background: #fff;
    box-shadow: var(--shadow-soft);
}

.address-result {
    width: 100%;
    text-align: left;
    padding: 0.45rem 0.6rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-primary);
    border-bottom: 1px solid rgba(51, 47, 47, 0.06);
    font-size: 0.92rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.address-result:last-child {
    border-bottom: none;
}

.address-result:hover {
    background: rgba(123, 100, 178, 0.08);
}

/* Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
}

.tab {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    color: var(--color-primary);
    font-weight: 600;
    transition: background 0.2s ease;
}

.tab:hover {
    background: rgba(123, 100, 178, 0.08);
}

.tab.active {
    background: var(--color-secondary);
    color: #fff;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .content {
        padding: 0 1rem !important;
    }
    
    /* Typography */
    .hero h1 {
        font-size: 2rem !important;
    }
    
    .hero p {
        font-size: 1.1rem !important;
    }
    
    h1, .page-title {
        font-size: 1.75rem !important;
    }
    
    h2 {
        font-size: 1.5rem !important;
    }
    
    /* Grid Layouts */
    .two-column-section {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }
    
    .services-grid {
        grid-template-columns: 1fr !important;
    }
    
    .services-list {
        grid-template-columns: 1fr !important;
    }
    
    .why-choose-grid {
        grid-template-columns: 1fr !important;
        gap: 1.5rem !important;
    }
    
    .service-cards {
        grid-template-columns: 1fr !important;
    }
    
    .industries-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .stats-grid,
    .user-stats {
        grid-template-columns: 1fr !important;
    }
    
    .products-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Tables - Make scrollable */
    .table-container {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    table, .table, .data-table {
        font-size: 0.875rem;
        min-width: 100%;
    }
    
    table td, table th,
    .table td, .table th,
    .data-table td, .data-table th {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Forms */
    .form-row, .form-row-2, .form-row-3 {
        grid-template-columns: 1fr !important;
    }
    
    .form-group label {
        font-size: 0.875rem;
    }
    
    .form-control {
        font-size: 16px !important; /* Prevents iOS zoom */
    }
    
    .search-bar {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .search-bar input[type="text"],
    .search-bar select {
        width: 100% !important;
        min-width: auto !important;
    }
    
    /* Cards */
    .card {
        padding: 1rem !important;
    }
    
    .item-card {
        padding: 1rem !important;
    }
    
    .product-card {
        padding: 1rem !important;
    }
    
    /* Buttons and Actions */
    .btn-group {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .btn-group .btn,
    .btn-group a {
        width: 100%;
        text-align: center;
    }
    
    .actions, .table-actions {
        flex-direction: column;
        align-items: stretch !important;
        gap: 0.5rem !important;
    }
    
    .actions .btn,
    .table-actions .btn {
        width: 100%;
        margin: 0 !important;
    }
    
    /* Modals */
    .modal-content,
    .modal-card {
        max-width: 100% !important;
        margin: 1rem;
        max-height: 90vh;
        overflow-y: auto;
    }
    
    /* Navigation */
    section {
        padding: 3rem 0 !important;
    }
    
    .nav-container {
        padding: 0 1rem;
    }
    
    .nav-menu {
        flex-wrap: wrap;
        gap: 0.5rem;
        font-size: 0.875rem;
    }
    
    .logo img {
        height: 60px !important;
    }
    
    /* Headers with actions */
    .user-header > div,
    .page-header > div {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .user-header .btn-group,
    .page-header .btn-group {
        width: 100%;
    }
    
    /* Admin nav */
    .admin-nav ul {
        flex-wrap: wrap;
        gap: 0.5rem !important;
    }
    
    .admin-nav li {
        flex: 1 1 auto;
    }
    
    .admin-nav a {
        padding: 0.5rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Tabs */
    .tabs, .user-tabs ul {
        flex-wrap: wrap;
        gap: 0.25rem !important;
    }
    
    .tab, .user-tabs a {
        padding: 0.5rem 0.75rem !important;
        font-size: 0.875rem !important;
    }
    
    /* Checkout specific */
    .cart-summary {
        position: static !important;
        margin-top: 2rem;
        top: auto !important;
    }
    
    .checkout-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 1rem !important;
    }
    
    .cart-item-image {
        width: 100% !important;
        max-width: 200px;
        margin-bottom: 1rem;
    }
    
    .cart-item-details {
        width: 100% !important;
    }
    
    .cart-item-price {
        width: 100% !important;
        text-align: left !important;
        margin-top: 0.5rem !important;
    }
    
    .shipping-method-label {
        padding: 0.75rem !important;
        font-size: 0.9rem !important;
    }
    
    .shipping-method-label input[type="radio"] {
        margin-right: 0.5rem !important;
    }
    
    .assignment-item {
        padding: 1rem !important;
    }
    
    .checkout-section {
        padding: 1rem !important;
    }
    
    /* Product detail */
    .product-detail-grid {
        grid-template-columns: 1fr !important;
    }
    
    .product-image {
        max-height: 300px;
    }
    
    /* CTA Section */
    .cta-section h2 {
        font-size: 2rem !important;
    }
    
    /* Content */
    .content {
        padding: 2rem 1rem !important;
    }
    
    /* Stat cards */
    .stat-card {
        min-width: auto !important;
    }
    
    /* Filters */
    .filters {
        flex-direction: column;
        gap: 0.75rem !important;
    }
    
    .filters > * {
        width: 100% !important;
    }
    
    /* Sample/Order cards */
    .sample-grid,
    .order-grid,
    .items-grid {
        grid-template-columns: 1fr !important;
    }
    
    /* Hide non-essential table columns on mobile */
    .hide-mobile {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 1.5rem !important;
    }
    
    .hero p {
        font-size: 1rem !important;
    }
    
    h1, .page-title {
        font-size: 1.5rem !important;
    }
    
    .industries-grid {
        grid-template-columns: 1fr !important;
    }
    
    .btn, .cta-button {
        padding: 0.75rem 1.25rem !important;
        font-size: 0.95rem !important;
    }
    
    .nav-menu {
        font-size: 0.75rem;
        gap: 0.25rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    /* Make badges stack */
    .badge {
        display: block !important;
        margin: 0.25rem 0 !important;
    }
    
    /* Simplify stat displays */
    .stat-value {
        font-size: 1.5rem !important;
    }
    
    .stat-label {
        font-size: 0.75rem !important;
    }
}


