/* Ensure header and sidebar/nav are dark with white text */
.portal-header,
.sidebar-nav {
    background: #232f3e !important;
    color: #fff !important;
}

.sidebar-nav ul,
.sidebar-nav li,
.sidebar-nav a,
.portal-header .dalcart-logo,
.portal-header h1,
.portal-header .dalcart-hero-tagline,
.portal-header .dalcart-hero-region {
    color: #fff !important;
}

.sidebar-nav a.nav-link {
    background: none !important;
    color: #fff !important;
}

.sidebar-nav a.nav-link.active,
.sidebar-nav a.nav-link:hover {
    background: #ffb300 !important;
    color: #232f3e !important;
}

/* Ensure strong text contrast everywhere */
body,
h1,
h2,
h3,
h4,
h5,
h6,
p,
label,
input,
select,
textarea,
li,
.portal-main,
.portal-instructions,
.modal-content,
.admin-section,
.form-header,
.form-section,
.form-group,
.form-row,
.container {
    color: #232f3e !important;
}

/* Portal Navigation Bar Styles */
.portal-nav {
    background: #25383C;
    color: #fff;
    width: 100%;
    min-height: 70px;
    border-bottom: 2px solid #ffb300;
    font-family: inherit;
    z-index: 100;
}

.portal-nav .nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1.1rem;
    margin-right: 1.2rem;
    transition: color 0.2s;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.portal-nav .nav-link:last-child {
    margin-right: 0;
}

.portal-nav .nav-link:hover,
.portal-nav .nav-link.active {
    color: #ffb300;
}

.portal-nav .logo.dalcart-logo {
    height: 48px;
    width: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px;
}

@media (max-width: 900px) {
    .portal-nav {
        flex-direction: column;
        padding: 0 0.5rem;
    }

    .portal-nav .nav-link {
        font-size: 1rem;
        margin-right: 0.7rem;
    }

    .portal-nav .logo.dalcart-logo {
        height: 36px;
    }
}

@media (max-width: 600px) {
    .portal-nav {
        flex-direction: column;
        padding: 0 0.2rem;
    }

    .portal-nav .nav-link {
        font-size: 0.98rem;
        margin-right: 0.4rem;
    }

    .portal-nav .logo.dalcart-logo {
        height: 28px;
    }
}

/* Admin Dashboard Styles */
.admin-section {
    background: #f8f9fa;
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    margin-bottom: 2rem;
    padding: 1.5rem 1.2rem;
    box-shadow: 0 1px 6px #b3c6e033;
}

.admin-section h3 {
    margin-top: 0;
    color: #1abc9c;
}

.admin-section button {
    background: #25383C;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: background 0.2s;
}

.admin-section button:hover {
    background: #ffb300;
    color: #25383C;
}

.admin-section textarea {
    font-family: inherit;
    font-size: 1rem;
    border-radius: 6px;
    border: 1px solid #bbb;
    padding: 0.7rem;
    background: #fff;
    color: #25383C;
}

/* Modal Styles for Admin Login */
.modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
}

.modal-content {
    background: #fff;
    color: #25383C;
    padding: 2rem 2.5rem;
    border-radius: 10px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    min-width: 320px;
    max-width: 90vw;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.modal-content h2 {
    margin-top: 0;
    font-size: 1.5rem;
    color: #25383C;
}

.modal-content label {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.modal-content input[type="text"],
.modal-content input[type="password"] {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #bbb;
    border-radius: 5px;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-actions button {
    background: #25383C;
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1.25rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-actions button:hover {
    background: #ffb300;
    color: #25383C;
}

.error-message {
    color: #b00;
    font-size: 1rem;
    margin-top: 0.5rem;
    min-height: 1.2em;
}

/* Dalcart Forms Portal - Modern Sidebar Layout */
.portal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    background: #25383C;
    color: #fff;
    padding: 1rem 0 1rem 2rem;
    border-bottom: 2px solid #ffb300;
    width: 100vw;
    box-sizing: border-box;
    position: relative;
}

.header-branding {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.header-branding .dalcart-logo {
    height: 60px;
    width: auto;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 4px;
}

.header-actions {
    display: flex;
    gap: 1rem;
    margin-left: auto;
    margin-right: 2rem;
    align-items: flex-start;
}

#darkModeToggle,
#adminLoginBtn {
    background: #fff;
    color: #25383C;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

#darkModeToggle:hover,
#adminLoginBtn:hover {
    background: #ffb300;
    color: #25383C;
}

.portal-layout {
    display: flex;
    min-height: 80vh;
    background: #f7f7f7;
}

.sidebar-nav {
    min-width: 220px;
    background: #2c3e50;
    color: #fff;
    padding: 2rem 1rem 2rem 2rem;
    border-right: 2px solid #ffb300;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 1.5rem;
}

.nav-link {
    background: none;
    color: #fff;
    border: none;
    font-size: 1.1rem;
    text-align: left;
    width: 100%;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    background: #ffb300;
    color: #25383C;
}

.portal-main {
    flex: 1;
    padding: 2.5rem 2rem;
    background: #fff;
    border-radius: 0 0 12px 12px;
    min-height: 600px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
    margin: 2rem 2rem 2rem 0;
}

#portalTitle {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    color: #25383C;
}

.notification {
    margin-top: 1.5rem;
    padding: 1rem;
    border-radius: 6px;
    background: #e6ffed;
    color: #22543d;
    font-weight: 500;
    border: 1px solid #38a169;
    display: none;
}

.portal-footer {
    text-align: center;
    padding: 1.5rem 0 1rem 0;
    color: #888;
    background: none;
    font-size: 0.95rem;
}

@media (max-width: 900px) {
    .portal-layout {
        flex-direction: column;
    }

    .sidebar-nav {
        flex-direction: row;
        min-width: 0;
        width: 100%;
        border-right: none;
        border-bottom: 2px solid #ffb300;
        padding: 1rem 0.5rem;
    }

    .sidebar-nav ul {
        display: flex;
        gap: 1rem;
        width: 100%;
        justify-content: center;
    }

    .sidebar-nav li {
        margin-bottom: 0;
    }

    .portal-main {
        margin: 0;
        border-radius: 0 0 12px 12px;
        min-height: 400px;
        padding: 1.5rem 0.5rem;
    }
}

@media (max-width: 600px) {
    .portal-header {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0.5rem;
    }

    .portal-main {
        padding: 1rem 0.25rem;
    }
}

body.dark-mode,
.portal-main.dark-mode {
    background: #181c1f !important;
    color: #f7f7f7 !important;
}

body.dark-mode .portal-header,
body.dark-mode .sidebar-nav {
    background: #181c1f !important;
    color: #fff !important;
}

body.dark-mode .portal-main {
    background: #23272a !important;
    color: #f7f7f7 !important;
}

body.dark-mode .nav-link {
    color: #fff !important;
}

body.dark-mode .nav-link.active,
body.dark-mode .nav-link:hover {
    background: #ffb300 !important;
    color: #23272a !important;
}

/* --- MODERN FORM STYLES (2025) --- */
.portal-form {
    max-width: 540px;
    margin: 0 auto;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.07);
    padding: 2.2rem 2rem 1.5rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.portal-form .form-section {
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #e6e6e6;
}

.portal-form .form-section:last-child {
    border-bottom: none;
}

.portal-form h1.form-title,
.portal-form .form-section h2,
.portal-form .form-section h3 {
    font-family: inherit;
    font-weight: 700;
    color: #1a2633;
    margin-bottom: 0.7rem;
    letter-spacing: 0.01em;
}

.portal-form .form-section h2 {
    font-size: 1.25rem;
    margin-top: 0.5rem;
}

.portal-form .form-section h3 {
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.portal-form .form-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
    margin-bottom: 0.7rem;
}

.portal-form .form-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 180px;
    min-width: 120px;
    margin-bottom: 0.5rem;
    position: relative;
}

.portal-form label {
    font-weight: 500;
    margin-bottom: 0.18rem;
    color: #25383C;
    font-size: 1rem;
    letter-spacing: 0.01em;
}

.portal-form .required {
    color: #c0392b;
    margin-left: 0.2em;
    font-size: 1.1em;
}

.portal-form input,
.portal-form select,
.portal-form textarea {
    font-size: 1rem;
    padding: 0.5rem 0.7rem;
    border-radius: 6px;
    border: 1.5px solid #cfd8dc;
    background: #f9fafb;
    color: #25383C;
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
    margin-bottom: 0.1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.portal-form input:focus,
.portal-form select:focus,
.portal-form textarea:focus {
    border-color: #1a4d8f;
    background: #fff;
    box-shadow: 0 0 0 2px #1a4d8f22;
}

.portal-form input[readonly],
.portal-form input[disabled],
.portal-form select[disabled],
.portal-form textarea[readonly],
.portal-form textarea[disabled] {
    background: #f0f0f0;
    color: #888;
    border-style: dashed;
}

.portal-form textarea {
    min-height: 2.5em;
    resize: vertical;
}

.portal-form .form-group .microcopy,
.portal-form .form-group .help-text {
    font-size: 0.97em;
    color: #6c757d;
    margin-top: 0.1em;
    margin-bottom: 0.1em;
    line-height: 1.3;
}

.portal-form .error-message {
    color: #c0392b;
    font-size: 0.98em;
    margin-top: 0.1em;
    min-height: 1.2em;
    font-weight: 500;
    letter-spacing: 0.01em;
}

.portal-form input:invalid,
.portal-form select:invalid,
.portal-form textarea:invalid {
    border-color: #c0392b;
}

.portal-form input:invalid:focus,
.portal-form select:invalid:focus,
.portal-form textarea:invalid:focus {
    box-shadow: 0 0 0 2px #c0392b33;
}

.portal-form .success-message {
    color: #1abc9c;
    font-size: 1em;
    margin-top: 0.2em;
    font-weight: 500;
}

.portal-form .form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1.2rem;
    margin-top: 1.2rem;
}

.portal-form .submit-button {
    background: linear-gradient(90deg, #1a4d8f 60%, #25383C 100%);
    color: #fff;
    font-weight: 600;
    font-size: 1.08rem;
    border: none;
    border-radius: 6px;
    padding: 0.7rem 2.2rem;
    box-shadow: 0 2px 8px rgba(26, 77, 143, 0.08);
    cursor: pointer;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
    letter-spacing: 0.01em;
}

.portal-form .submit-button:hover,
.portal-form .submit-button:focus {
    background: linear-gradient(90deg, #ffb300 60%, #1a4d8f 100%);
    color: #23272a;
    box-shadow: 0 4px 16px rgba(255, 179, 0, 0.13);
}

.portal-form .manage-button {
    background: #888;
    color: #fff;
    border: none;
    border-radius: 5px;
    padding: 0.5rem 1.2rem;
    font-size: 1rem;
    cursor: pointer;
    margin-top: 0.2rem;
    transition: background 0.2s, color 0.2s;
}

.portal-form .manage-button.remove-product-btn {
    background: #c0392b;
}

.portal-form .manage-button:hover {
    background: #1a4d8f;
    color: #fff;
}

.portal-form .manage-button.remove-product-btn:hover {
    background: #ffb300;
    color: #23272a;
}

.portal-form .logo-header {
    text-align: center;
    margin-bottom: 0.5rem;
}

.portal-form .always-visible-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 0.5rem auto;
}

/* Responsive: single column, mobile-first */
@media (max-width: 700px) {
    .portal-form {
        padding: 1.2rem 0.5rem 1rem 0.5rem;
        max-width: 99vw;
    }

    .portal-form .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .portal-form .form-actions {
        flex-direction: column;
        gap: 0.5rem;
        align-items: stretch;
    }
}

/* Dark mode for forms */
body.dark-mode .portal-form {
    background: #23272a !important;
    color: #f7f7f7 !important;
    box-shadow: 0 4px 32px rgba(0, 0, 0, 0.18);
}

body.dark-mode .portal-form label,
body.dark-mode .portal-form .form-title,
body.dark-mode .portal-form .form-section h2,
body.dark-mode .portal-form .form-section h3 {
    color: #ffb300 !important;
}

body.dark-mode .portal-form input,
body.dark-mode .portal-form select,
body.dark-mode .portal-form textarea {
    background: #181c1f !important;
    color: #f7f7f7 !important;
    border: 1.5px solid #444 !important;
}

body.dark-mode .portal-form input:focus,
body.dark-mode .portal-form select:focus,
body.dark-mode .portal-form textarea:focus {
    border-color: #ffb300 !important;
    box-shadow: 0 0 0 2px #ffb30033 !important;
    background: #23272a !important;
}

body.dark-mode .portal-form .error-message {
    color: #ff6b6b !important;
}

body.dark-mode .portal-form .success-message {
    color: #1abc9c !important;
}

body.dark-mode .portal-form .submit-button {
    background: linear-gradient(90deg, #ffb300 60%, #1a4d8f 100%) !important;
    color: #23272a !important;
}

body.dark-mode .portal-form .submit-button:hover,
body.dark-mode .portal-form .submit-button:focus {
    background: linear-gradient(90deg, #1a4d8f 60%, #ffb300 100%) !important;
    color: #fff !important;
}

/* Accessibility: focus ring for all interactive elements */
.portal-form input:focus-visible,
.portal-form select:focus-visible,
.portal-form textarea:focus-visible,
.portal-form button:focus-visible {
    outline: 2px solid #1a4d8f;
    outline-offset: 2px;
}