/* Shared styles extracted from pages: login, privacy, terms, signup, contact */
/* Screen reader only content */
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border:0 !important; }
.sr-only-focusable:focus { position: static !important; width: auto !important; height: auto !important; padding: 0.25rem 0.5rem !important; margin: 0 !important; overflow: visible !important; clip: auto !important; white-space: normal !important; background-color: #007bff !important; color: white !important; text-decoration: none !important; border-radius: 4px !important; font-weight: 600 !important; }

/* Generic container conventions */
.login-form{padding:10px;}
@media (max-width: 599px) {
    .login-container {
        max-width: 420px;
        margin: 0 auto;
        padding: 10px;
        width: auto;
    }
}
.signup-container, .terms-container, .contact-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 10px;
}

/* Ensure elements using the legacy "opacityit" class have a visible keyboard focus indicator
   and are treated as inline-block so the outline/border is visible around the control. */
.opacityit {
    display: inline-block; /* ensure focus outline wraps the visual element */
}
.opacityit:focus,
.opacityit:focus-visible {
    outline: 3px solid #005FCC; /* high-contrast blue */
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(0,95,204,0.12);
    border-radius: 4px;
}
.main-container {
    max-width: 900px; /* Maximum width */
    margin: 0 auto;
    padding: 15px; /* Padding inside the container */   
}
.spacer { height: 10px; }

/* Card common styles - consolidated from styles.css and inline page styles */
.card { 
    background: white; 
    border: 2px solid #666666; 
    border-radius: 0; 
    box-shadow: none; 
    display: flex; 
    flex-direction: column; 
    overflow: hidden;
    min-width: 0 !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

.card-header {
    /* Keep original theme color while providing an explicit background for contrast checks */
    background-color: var(--theme-color);
    /* use rgba() built from RGB components + opacity variable */
    background-image: radial-gradient(circle, rgba(var(--dot-color), var(--dot-opacity)) var(--dot-size), transparent calc(var(--dot-size) + 0.5px));
    background-size: var(--dot-spacing) var(--dot-spacing);
    background-position: calc(var(--dot-spacing)/2) calc(var(--dot-spacing)/2);
    border: 1px solid #cc6600;
    border-bottom: none;
    border-radius: 0px !important;
    padding: 8px 12px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    min-height: 44px;
    box-sizing: border-box !important;
}

.card-header h2,
.card-header h3,
.card-header h6 { 
    font-size: 12pt; 
    font-weight: 700 !important; 
    margin: 0; 
    color: #000000 !important;
    background-color: transparent !important;
    white-space: normal !important;
    word-break: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
}

.card-body {
    padding: 0px;
    flex: 1;
    background: white;
    font-size: 11pt;
}

.card-body,
.card-body p,
.card-body div,
.card-body span,
.card-body label {
    color: #000000 !important;
    background-color: transparent !important;
}

.card-footer {
    background: #999999;
    border-top: none;
    border-radius: 0px !important;
    padding: 8px 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 44px;
}

/* Notices */
.terms-notice, .contact-notice { color: white; margin: 0; font-size: 12px; text-align: center; }

/* Scrollable terms/contact area */
.terms-scroll-container, #signup-scroll, .contact-scroll, .terms-scroll {
    height: auto;
    overflow: visible;
    
    padding: 10px;
    border: 1px solid #e0e0e0;
    background: #fafafa;
    border-radius: 4px;
    outline: none;
}
.terms-scroll-container:focus, #signup-scroll:focus { border-color: #007bff; box-shadow: 0 0 0 2px rgba(0,123,255,0.25); }

/* Form styles */
.form-group, .form-row { margin-bottom: 8px; }
.form-instructions { font-size: 10pt; color: #555; margin-bottom: 12px; line-height: 1.4; }
.form-label, legend.form-label {
    display: block;
    margin-bottom: 4px;
    font-weight: bold;
    font-size: 10pt;
    color: #333;
    height: 15px;
}
.input-group { display: flex; flex-direction: column; }
.form-input { width: 100%; padding: 8px; border: 1px solid #999; border-radius: 0; font-size: 10pt; background: white; box-sizing: border-box; min-height: 44px; }
.form-input:focus { border-color: #333; outline: 2px solid #007acc; outline-offset: 1px; background: #ffffcc; }
.validation-messages { margin-top: 4px; min-height: 10px; }
.validator { color: #B71C1C; font-size: 9pt; display: inline; margin-left: 4px; }
.error-message { color: #B71C1C; font-size: 11pt; display: block; margin-top: 6px; padding: 8px; background-color: #ffe6e6; border: 1px solid #ff9999; text-align: center; border-radius: 4px; }

/* Ensure modal close button has a clear visible focus indicator (WCAG SC 2.4.7) */
.modal .close:focus,
.close:focus {
    outline: 3px solid #ffffff; /* white outline visible on modal header's red background */
    outline-offset: 2px;
    border-radius: 4px;
}

/* Small utilities used by multiple pages */
.notice-banner { background:#ffffcc; padding:8px; border-left:4px solid #ffcc33; margin-bottom:12px; }
.name-row, .city-row { display:flex; gap:8px; align-items:center; }
.actions-row { display:flex; gap:8px; align-items:center; }

/* Terms specific */
.terms-content { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; }
.terms-document-header { text-align: center; margin-bottom: 20px; }
.terms-document-header h3 { font-size: 16px; font-weight: bold; color: #8B4513; margin: 0; }
.terms-list { margin: 0; padding-left: 30px; }
.terms-list li { margin-bottom: 12px; font-size: 11px; color: #444; text-align: justify; }
.terms-document-footer { text-align: center; margin-top: 30px; padding: 15px; background: #e9ecef; border-radius: 4px; }

/* Contact specific */
.contact-content { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; line-height:1.6; color:#333; padding: 0 10px; }
.contact-document-header h3 { font-size: 16px; font-weight: bold; color: #8B4513; margin: 0; }

/* Accessibility helpers */
[role="alert"] { font-weight: 600; }

/* Responsive */
@media (max-width: 1280px) {
  .checkout-cards,
  .main-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 8px !important;
  }

  .card {
    min-width: 0 !important;
    width: 100% !important;
  }

  .card-header, .card-body {
    padding: 8px !important;
  }
}

@media (max-width: 768px) {
  .login-container, .signup-container, .terms-container, .contact-container { padding: 10px; }
  .form-input { min-height: 48px; font-size: 16px; }
  .form-row { flex-direction: column; align-items: stretch; }
  .form-label { width: 100%; }
  .card-header, .card-body { padding: 8px !important; }
}

@media (prefers-contrast: high) {
  .card { border: 3px solid #000; }
  .form-input:focus { border: 3px solid #000; outline: 3px solid #ffff00; }
}

@media print { .card { border: 2px solid #000; } .terms-scroll-container, #signup-scroll { height: auto; overflow: visible; } }

/* End shared styles */

/* Name grid for signup page */
.name-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 8px;
    align-items: start;
}
.name-field { display: flex; flex-direction: column; }
.name-field .form-label { width: auto; margin-bottom: 4px; }
.name-field .form-input { width: 100% !important; box-sizing: border-box; }

@media (max-width: 768px) {
  .name-grid { grid-template-columns: 1fr; }
}

/* City/State/ZIP grid */
.city-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 2fr;
    gap: 8px;
    align-items: start;
}
.city-field { display:flex; flex-direction: column; }
.city-field .form-label { width: auto; margin-bottom: 4px; }
.city-field .form-input { width: 100% !important; box-sizing: border-box; }

@media (max-width: 768px) {
  .city-grid { grid-template-columns: 1fr; }
}

/* Grid header accessibility: ensure sufficient contrast and avoid relying on background images */
.gvHeader {
    background-image: none !important;
    background-color: #5E5E5E !important; /* Updated header color */
    color: #ffffff !important; /* light text for contrast */
    font-weight: 700;
}
.gvHeader td, .gvHeader th {
    color: #ffffff !important;
    background-color: #5E5E5E !important;
    border: 1px solid #ffffff !important;
    font-weight: 700 !important;
}

/* Enhanced GridView styles for all pages */
.gridview-container {
    overflow-x: auto;
    max-width: 100%;
}

.gridview-responsive td,
.gridview-responsive th {
    white-space: normal !important;
    word-wrap: break-word !important;
    min-width: 0 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    padding: 4px !important;
}
/* No data message styling */
.noData {
    color: #000000 !important;
    font-weight: 600 !important;
    text-align: center !important;
    padding: 16px !important;
    background-color: #ffffff !important;
}

/* Filter grid layout */
.filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 8px;
    align-items: start;
}

.filter-card {
    background: transparent;
    padding: 10px;
}

.filter-card p {
    color: #000000 !important;
}

/* Search container responsive */
.search-container {
    max-width: 100%;
    margin: 0 auto;
    padding: 8px;
}

/* Pager styling (consolidated) */
.hg-pager {
    flex-wrap: wrap !important;
    gap: 4px !important;
    justify-content: center !important;
    padding: 8px 4px !important;
}

.hg-pager a,
.hg-pager span {
    color: #000000 !important;
    background-color: #ffffff !important;
    border: 1px solid #cccccc !important;
    min-height: 32px !important;
    padding: 4px 8px !important;
    text-decoration: none !important;
    min-width: 32px !important;
    text-align: center !important;
    word-break: break-all !important;
    border-radius: 4px !important;
}

/* Hover / focus (including focus-visible) unified for accessibility */
.hg-pager a:hover,
.hg-pager a:focus,
.hg-pager a:focus-visible {
    color: #ffffff !important;
    background-color: #0066cc !important;
    border-color: #0066cc !important;
    text-decoration: underline !important;
}

.hg-pager .current,
.hg-pager span[aria-current="page"],
.hg-pager [style*="font-weight:bold"] {
    color: #ffffff !important;
    background-color: #999999 !important;
    border-color: #999999 !important;
    font-weight: bold !important;
}

/* Responsive design breakpoints */
@media (max-width: 1280px) {
    .terms-container,
    .search-container,
    .checkout-cards {
        padding: 4px !important;
        max-width: 100% !important;
    }

    .card {
        min-width: 0 !important;
        width: 100% !important;
        margin-bottom: 8px !important;
    }

    .card-header {
        flex-direction: column !important;
        gap: 8px !important;
        align-items: stretch !important;
    }

    .card-body {
        padding: 8px !important;
    }

    .filter-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 6px !important;
    }
}

@media (max-width: 960px) {
    .filter-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 768px) {
    .terms-container,
    .search-container,
    .checkout-cards {
        padding: 2px !important;
    }

    .card-body {
        padding: 4px !important;
    }

    .filter-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 4px !important;
    }

    .filter-card {
        padding: 6px !important;
    }

    .card-header h2,
    .card-header h3 {
        font-size: 14px !important;
    }
}

@media (max-width: 480px) {
    .filter-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .search-container,
    .checkout-cards {
        padding: 2px !important;
    }

    .card {
        margin-bottom: 4px !important;
    }

    .filter-grid > div:last-child {
        grid-column: 1 / -1 !important;
        display: flex !important;
        gap: 8px !important;
        justify-content: center !important;
        margin-top: 8px !important;
        flex-direction: column !important;
    }

}

/* Checkout specific styles */
.checkout-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 820px;
    margin: 0 auto;
}

/* Global loading backdrop and spinner used by master pages */
.page-backdrop {
    position: fixed;
    inset: 0;
    display: none; /* toggled by script */
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.5);
    z-index: 9999;
}
.page-backdrop[aria-hidden="true"] { display: none; }
.page-backdrop[aria-hidden="false"] { display: flex; }
.page-loader {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    border: 8px solid rgba(255,255,255,0.18);
    border-top-color: #ffffff;
    animation: olis-spin 1s linear infinite;
    box-shadow: 0 0 12px rgba(0,0,0,0.6);
}
@keyframes olis-spin { to { transform: rotate(360deg); } }


/* Footer contrast: ensure footer and footer links have explicit background and foreground colors
   so accessibility tools can determine contrast even when a background image is used. */
footer {
    background-color: #5E5E5E !important;
}
footer a, footer a:link, footer a:visited {
    color: #ffffff !important;
    text-decoration: underline;
}
footer a:hover, footer a:focus {
    color: #ffffff !important;
    text-decoration: none;
    outline: 2px solid #007acc;
}

/* Modernized top navigation styles for asp:Menu / asp:MenuItem
   Works with RenderingMode="List" (ul/li) and provides dropdown support. */
/* TopMenu styles moved to styles.css to centralize legacy theme styles. */

ul.level1.TopMenuItems > li {
    border-right: 3px solid white;
}

/* Styles moved from MasterPage.master to consolidate shared styles */
/* Visible skip link on focus for keyboard users - moved from MasterPage.master */
.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus {
    position: fixed !important;
    left: 10px !important;
    top: 10px !important;
    width: auto !important;
    height: auto !important;
    padding: 8px 12px !important;
    background: #000 !important;
    color: #fff !important;
    z-index: 10000 !important;
    text-decoration: none !important;
    border-radius: 4px !important;
}

/* Header/grid responsive rules originally in MasterPage.master */
@media (max-width: 540px) {
    .header-grid { grid-template-columns: 1fr !important; grid-template-rows: auto auto !important; }
    .header-grid .logo-area { width: 100% !important; }
    .header-grid .menu-row { grid-column: 1 / span 1 !important; justify-content: flex-end !important; }
    #title.totherL, .totherL { display: flex !important; flex-wrap: wrap !important; gap: 6px !important; align-items: center !important; justify-content: center !important; }
    #title.totherL span, .totherL span { white-space: normal !important; display: inline-block !important; }
    .header-grid img { max-width: 100% !important; height: auto !important; }
}


@media (max-width: 320px) {
    .header-grid .menu-row {
        grid-column: 1 / span 1 !important;
        justify-content: flex-end !important;
    }
}

/* Footer helpers moved from MasterPage.master */
footer, footer div { min-width: 0; }
.lblFoofter{ display: inline-block; white-space: normal; max-width: 100%; word-break: break-word; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.footer-nav a { color: white !important; text-decoration: underline; white-space: normal !important; display: inline-block !important; word-break: break-word !important; max-width: 100%; }
.footer-nav a:hover, .footer-nav a:focus { color: #ccc !important; }
.footer-separator { color: white; user-select: none; }

@media (max-width: 540px) {
    .footer-nav a { white-space: normal !important; display: inline-block !important; word-break: break-word !important; max-width: 100% !important; }
    .footer-nav { flex-direction: column; gap: 4px; }
    .footer-separator { display: none !important; }
}

@media (max-width: 320px) {
    footer { padding: 8px 4px !important; }
    .footer-nav { gap: 2px; }
    .footer-nav a { font-size: 12px !important; padding: 4px !important; }
}

/* ASP.NET Menu responsive fixes (moved from MasterPage.master) */
/* Ensure menu appears above cards and other content */
.menu-row,
.menu-row nav,
div.TopMenu {
    position: relative;
    z-index: 1000;
}

.TopMenu ul.static {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
}
.TopMenu a.level1.static,
.TopMenu a.level1 {
    white-space: nowrap !important;
    padding: 0px 12px !important;
    display: block !important;
    min-height: 17px !important;
    box-sizing: border-box !important;
}

@media (max-width: 768px) {
    .TopMenu ul.static { flex-direction: column !important; align-items: stretch !important; width: 100% !important; }
    .TopMenu a.level1.static, .TopMenu a.level1 { text-align: center !important; border-bottom: 1px solid #333 !important; font-size: 12px !important; }
    .menu-row { justify-content: flex-end !important; }
    /* Override ASP.NET Menu inline float:left styles to support flex layout */
    div.TopMenu, div.TopMenu ul.level1 { float: none !important; }
    div.TopMenu ul.level1 > li { float: none !important; }

    /* Position submenus to the left instead of below on small screens */
    .TopMenu ul.level2.dynamic {
        top: 0 !important;
        left: auto !important;
        right: 100% !important;
        min-width: 150px !important;
    }
}

@media (max-width: 480px) {
    .TopMenu a.level1.static, .TopMenu a.level1 { padding: 0px 8px !important; font-size: 11px !important; min-height: 17px !important; }
    .header-grid { grid-template-columns: 1fr !important; }
    .logo-area { text-align: center !important; }
}

@media (min-width: 600px) {
    .truncate { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

@media (max-width: 599px) {
    .truncate { white-space: normal !important; overflow: visible !important; text-overflow: clip !important; }
    .TopMenu a.level1.static, .TopMenu a.level1 { white-space: normal !important; display: inline-block !important; word-break: break-word !important; max-width: 100% !important; padding-left: 8px !important; padding-right: 8px !important; box-sizing: border-box !important; }
    .TopMenu ul.static { justify-content: center !important; }
}

/* Responsive grid: allow left column to shrink and collapse to one column on small viewports.
       Use minmax so the first column can reduce without causing horizontal scrolling at 400% zoom. */
.my-grid {
    display: grid;
    grid-template-columns: minmax(120px, 240px) 1fr;
    gap: 12px;
    align-items: start;
}

.my-grid .card {
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 12px;
    background: #fff;
}

.my-grid .card-header {
    font-weight: bold;
}
}



.search-box {
    margin-top: 12px;
    padding: 8px;
    border: 1px solid #ccc;
    background: #fff;
    font-size: 8pt;
}

.name-search {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.case-search {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    align-items: center;
}

.span-two {
    grid-column: span 2;
}

.span-three {
    grid-column: span 3;
}

/* Stack name-search and case-search vertically on small screens */
@media (max-width: 768px) {
    .name-search,
    .case-search {
        grid-template-columns: 1fr !important;
    }

    .name-search .form-label,
    .case-search .form-label {
        display: block !important;
        width: 100% !important;
        margin-bottom: 6px !important;
    }

    .span-two,
    .span-three {
        grid-column: 1 !important;
    }
}

.recent-purchase {
    border: 1px solid #cfcfcf;
}

.recent-purchase-header {
    display: grid;
    grid-template-columns: 160px 1fr;
    background: #ccffff;
    padding: 6px;
    font-weight: bold;
}

.recent-purchase-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    padding: 8px;
    gap: 8px;
}

@media (max-width: 540px) {
    .my-grid {
        grid-template-columns: 1fr;
    }

    .left-column, .right-column {
        width: 100%;
    }

    .recent-purchase-item {
        grid-template-columns: 1fr;
    }
}