/*
 * OneBestHost premium client-area design system.
 *
 * This enhancement layer is loaded after the existing Six-template styles.
 * It deliberately changes presentation only. WHMCS forms, route links, IDs,
 * CSRF fields, module output, gateway controls, and validation remain native.
 */

:root {
    --hp-primary: #0b63ce;
    --hp-primary-hover: #084da2;
    --hp-primary-soft: #eaf2ff;
    --hp-background: #f4f7f9;
    --hp-card: #ffffff;
    --hp-text: #102a3a;
    --hp-muted: #637784;
    --hp-border: #dce6ea;
    --hp-success: #0b8f68;
    --hp-warning: #b7791f;
    --hp-danger: #c2414b;
    --hp-info: #0b63ce;
    --hp-radius-sm: 8px;
    --hp-radius: 12px;
    --hp-radius-lg: 18px;
    --hp-sidebar-width: 272px;
    --hp-shadow-sm: 0 1px 2px rgba(12, 38, 53, .04);
    --hp-shadow: 0 12px 30px rgba(12, 38, 53, .07);
    --hp-focus: 0 0 0 3px rgba(11, 99, 206, .2);
    --hp-transition: 160ms ease;
}

html {
    background: var(--hp-background);
    color: var(--hp-text);
}

body {
    color: var(--hp-text);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
    font-family: inherit;
}

a {
    text-underline-offset: 2px;
}

a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 0;
}

/* Reusable components for page-specific templates added in later phases. */
.hp-card,
.hp-stat-card,
.hp-service-card,
.hp-domain-card,
.hp-invoice-card {
    background: var(--hp-card);
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    box-shadow: var(--hp-shadow-sm);
}

.hp-card { padding: 24px; }

.hp-page-header {
    align-items: flex-end;
    display: flex;
    gap: 20px;
    justify-content: space-between;
    margin-bottom: 24px;
}

.hp-page-header h1 {
    color: var(--hp-text);
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 750;
    letter-spacing: -.035em;
    line-height: 1.15;
    margin: 0;
}

.hp-page-header p {
    color: var(--hp-muted);
    margin: 8px 0 0;
}

.hp-stat-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.hp-stat-card { min-height: 124px; padding: 20px; }
.hp-stat-card__label { color: var(--hp-muted); font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.hp-stat-card__value { color: var(--hp-text); font-size: 34px; font-weight: 760; letter-spacing: -.04em; line-height: 1; margin-top: 18px; }

.hp-badge {
    align-items: center;
    background: #edf2f4;
    border: 1px solid transparent;
    border-radius: 999px;
    color: #4c626e;
    display: inline-flex;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    min-height: 26px;
    padding: 6px 10px;
}

.hp-badge--success { background: #e8f8f2; color: var(--hp-success); }
.hp-badge--warning { background: #fff6df; color: var(--hp-warning); }
.hp-badge--danger { background: #fff0f1; color: var(--hp-danger); }
.hp-badge--info { background: #eaf4fb; color: var(--hp-info); }

/* Global Six-template shell. */
#header {
    background: #fff;
    border-bottom: 1px solid var(--hp-border);
    min-height: 72px;
}

#header .logo { padding-bottom: 10px; padding-top: 10px; }

#header .top-nav > li > a,
#header .top-nav > li > button {
    border-radius: var(--hp-radius-sm);
    color: var(--hp-muted);
    min-height: 38px;
}

#main-menu,
#main-menu .navbar {
    background: #fff !important;
    border: 0;
}

#main-menu {
    border-bottom: 1px solid var(--hp-border) !important;
    box-shadow: none !important;
}

#main-menu .navbar-nav > li > a {
    border-radius: var(--hp-radius-sm) !important;
    color: var(--hp-text) !important;
    font-size: 13px !important;
    font-weight: 650 !important;
    margin: 7px 2px !important;
    padding: 10px 12px !important;
}

#main-menu .navbar-nav > li > a:hover,
#main-menu .navbar-nav > li > a:focus,
#main-menu .navbar-nav > li.active > a,
#main-menu .navbar-nav > li.open > a {
    background: var(--hp-primary-soft) !important;
    color: var(--hp-primary-hover) !important;
    transform: none !important;
}

#main-menu .dropdown-menu {
    border: 1px solid var(--hp-border) !important;
    border-radius: var(--hp-radius) !important;
    box-shadow: var(--hp-shadow) !important;
    padding: 6px !important;
}

#main-menu .dropdown-menu > li > a {
    border-radius: var(--hp-radius-sm) !important;
    min-height: 38px;
    padding: 10px 12px !important;
}

#main-body {
    background: var(--hp-background) !important;
    min-height: calc(100vh - 178px);
}

#main-body > .container { padding-bottom: 42px; padding-top: 34px; }

#main-body .header-lined {
    border: 0;
    margin-bottom: 24px;
    padding-bottom: 0;
}

#main-body .header-lined h1 {
    color: var(--hp-text) !important;
    font-size: clamp(28px, 3vw, 38px) !important;
    font-weight: 750 !important;
    letter-spacing: -.035em !important;
    line-height: 1.15;
}

#main-body .header-lined h1 small {
    color: var(--hp-muted);
    display: block;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0;
    line-height: 1.5;
    margin-top: 8px;
}

#main-body .breadcrumb {
    background: transparent;
    color: var(--hp-muted);
    font-size: 12px;
    margin: 12px 0 0;
    padding: 0;
}

/* Native panels become consistent dashboard cards. */
#main-body .panel,
#main-body .well,
#main-body .domain-renewal,
#main-body .ticket-reply,
#main-body .view-ticket,
#main-body .affiliate-stat {
    border-color: var(--hp-border);
    border-radius: var(--hp-radius-lg);
    box-shadow: var(--hp-shadow-sm);
}

#main-body .panel { overflow: hidden; }

#main-body .panel-heading {
    background: #f8fafb !important;
    border-bottom: 1px solid var(--hp-border) !important;
    color: var(--hp-text) !important;
    min-height: 52px;
    padding: 15px 18px;
}

#main-body .panel-title,
#main-body .panel-title a {
    color: var(--hp-text) !important;
    font-size: 14px;
    font-weight: 720 !important;
}

#main-body .panel-body { padding: 20px; }
#main-body .list-group-item { border-color: #eaf0f2; padding: 13px 18px; }

/* Existing WHMCS sidebars act as the left dashboard rail. */
#main-body .sidebar .panel {
    background: var(--hp-card);
    border: 1px solid var(--hp-border);
    box-shadow: var(--hp-shadow-sm);
}

#main-body .sidebar .panel-heading { background: #f8fafb !important; }

#main-body .sidebar .list-group-item {
    color: var(--hp-muted);
    font-size: 13px;
    min-height: 44px;
    padding: 12px 15px;
}

#main-body .sidebar .list-group-item:hover,
#main-body .sidebar .list-group-item:focus,
#main-body .sidebar .list-group-item.active {
    background: var(--hp-primary-soft);
    color: var(--hp-primary-hover);
}

/* Forms: retain native names, IDs, validation, CAPTCHA and submit behavior. */
.form-control,
#main-body input.form-control,
#main-body select.form-control,
#main-body textarea.form-control {
    background: #fff;
    border: 1px solid #cbd8de;
    border-radius: var(--hp-radius-sm);
    box-shadow: none;
    color: var(--hp-text);
    min-height: 44px;
    transition: border-color var(--hp-transition), box-shadow var(--hp-transition);
}

#main-body textarea.form-control { min-height: 112px; }

.form-control:focus,
#main-body input.form-control:focus,
#main-body select.form-control:focus,
#main-body textarea.form-control:focus {
    border-color: var(--hp-primary);
    box-shadow: var(--hp-focus);
}

#main-body label { color: var(--hp-text); font-size: 12px; font-weight: 700; }

/* Buttons retain their native semantic classes and event bindings. */
.btn {
    border-radius: var(--hp-radius-sm);
    font-weight: 650;
    min-height: 40px;
    padding: 9px 15px;
    transition: background-color var(--hp-transition), border-color var(--hp-transition), box-shadow var(--hp-transition), color var(--hp-transition);
}

.btn-primary,
.btn-success,
#main-body .btn-primary,
#main-body .btn-success {
    background: var(--hp-primary) !important;
    border-color: var(--hp-primary) !important;
    box-shadow: none !important;
    color: #fff !important;
}

.btn-primary:hover,
.btn-primary:focus,
.btn-success:hover,
.btn-success:focus,
#main-body .btn-primary:hover,
#main-body .btn-primary:focus,
#main-body .btn-success:hover,
#main-body .btn-success:focus {
    background: var(--hp-primary-hover) !important;
    border-color: var(--hp-primary-hover) !important;
    box-shadow: var(--hp-focus) !important;
}

.btn-default {
    background: #fff;
    border-color: #c8d6dc;
    color: var(--hp-text);
}

.btn-danger { background: var(--hp-danger); border-color: var(--hp-danger); }
.btn-warning { background: #fff8e5; border-color: #ead19a; color: #885c16; }

/* Alerts and validation output. */
.alert {
    border: 1px solid transparent;
    border-radius: var(--hp-radius);
    box-shadow: none;
    padding: 14px 16px;
}

.alert-success { background: #eaf8f3; border-color: #c3eadc; color: #087452; }
.alert-info { background: #edf6fb; border-color: #c9e3f1; color: #23648d; }
.alert-warning { background: #fff8e8; border-color: #efdda9; color: #805b16; }
.alert-danger { background: #fff1f2; border-color: #f1c9cd; color: #9d303a; }

/* Data tables used by services, domains, invoices, tickets and email history. */
#main-body .table-container,
#main-body .dataTables_wrapper,
#main-body .table-responsive {
    border-radius: var(--hp-radius-lg);
}

#main-body table.table {
    background: var(--hp-card);
    border: 1px solid var(--hp-border);
    border-collapse: separate;
    border-radius: var(--hp-radius-lg);
    border-spacing: 0;
    margin-bottom: 20px;
    overflow: hidden;
}

#main-body table.table > thead > tr > th {
    background: #f8fafb;
    border-bottom: 1px solid var(--hp-border);
    color: var(--hp-muted);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: .045em;
    padding: 14px 15px;
    text-transform: uppercase;
    vertical-align: middle;
}

#main-body table.table > tbody > tr > td {
    border-top: 1px solid #eaf0f2;
    color: var(--hp-text);
    padding: 15px;
    vertical-align: middle;
}

#main-body table.table > tbody > tr:first-child > td { border-top: 0; }
#main-body table.table-striped > tbody > tr:nth-of-type(odd) { background: #fbfcfd; }
#main-body table.table-hover > tbody > tr:hover { background: #f2f8fa; }

.dataTables_wrapper .dataTables_filter input,
.dataTables_wrapper .dataTables_length select {
    border: 1px solid #cbd8de;
    border-radius: var(--hp-radius-sm);
    min-height: 40px;
}

/* Normalize native WHMCS status labels without changing their values. */
#main-body .label,
#main-body .status,
#main-body [class*="status-"] {
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1;
    padding: 7px 10px;
}

#main-body .label-success,
#main-body .status-active,
#main-body .status-paid,
#main-body .status-open,
#main-body .status-answered { background: #e8f8f2 !important; color: var(--hp-success) !important; }

#main-body .label-warning,
#main-body .status-pending,
#main-body .status-unpaid,
#main-body .status-customer-reply { background: #fff6df !important; color: var(--hp-warning) !important; }

#main-body .label-danger,
#main-body .status-overdue,
#main-body .status-suspended,
#main-body .status-fraud { background: #fff0f1 !important; color: var(--hp-danger) !important; }

#main-body .label-info,
#main-body .status-in-progress { background: #eaf4fb !important; color: var(--hp-info) !important; }

#main-body .label-default,
#main-body .status-cancelled,
#main-body .status-terminated,
#main-body .status-closed,
#main-body .status-refunded { background: #edf2f4 !important; color: #526772 !important; }

/* Dashboard tiles supplied by WHMCS continue to use live counts. */
#main-body .tiles {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0 0 24px;
}

#main-body .tiles > .row {
    display: contents;
}

/* Bootstrap 3 clearfix pseudo-elements become real grid items when a row uses
 * display: contents. Remove only those generated boxes so WHMCS tiles retain
 * their native links and source order. */
#main-body .tiles::before,
#main-body .tiles::after,
#main-body .tiles > .row::before,
#main-body .tiles > .row::after {
    content: none !important;
    display: none !important;
}

#main-body .tiles > [class*="col-"],
#main-body .tiles > .row > [class*="col-"] {
    float: none;
    padding: 0;
    width: auto;
}

#main-body .tiles .tile {
    background: linear-gradient(145deg, #0b63ce 0%, #084da2 100%) !important;
    border: 1px solid #0b58b9 !important;
    border-radius: var(--hp-radius-lg) !important;
    box-shadow: 0 12px 26px rgba(11, 99, 206, .2) !important;
    margin: 0 !important;
    min-height: 124px !important;
    padding: 20px !important;
}

#main-body .tiles .tile::before { display: none !important; }
#main-body .tiles .tile .tile-stat,
#main-body .tiles .tile .tile-title,
#main-body .tiles .tile .tile-title span,
#main-body .tiles .tile .stat,
#main-body .tiles .tile .title,
#main-body .tiles .tile > a,
#main-body .tiles .tile .fas,
#main-body .tiles .tile .far,
#main-body .tiles .tile .fa { color: #fff !important; }
#main-body .tiles .tile .tile-stat { font-size: 34px !important; font-weight: 760 !important; }
#main-body .tiles .tile .tile-title,
#main-body .tiles .tile .tile-title span,
#main-body .tiles .tile .title { opacity: .9; }

/* Ticket conversation and invoice detail surfaces. */
#main-body .ticket-reply,
#main-body .ticket-reply.staff,
#main-body .ticket-reply.admin {
    background: #fff;
    border: 1px solid var(--hp-border);
    margin-bottom: 16px;
    overflow: hidden;
}

#main-body .ticket-reply.staff,
#main-body .ticket-reply.admin { border-left: 4px solid var(--hp-primary); }
#main-body .ticket-reply .date { color: var(--hp-muted); }

#main-body .ticket-reply .message,
#main-body .ticket-reply .type,
#main-body .ticket-reply .attachments {
    overflow-wrap: anywhere;
    word-break: break-word;
}

#main-body .invoice-container {
    background: #fff;
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    box-shadow: var(--hp-shadow);
}

/* Pagination and modals. */
.pagination > li > a,
.pagination > li > span {
    border-color: var(--hp-border);
    color: var(--hp-primary);
    margin: 0 2px;
    min-height: 38px;
    min-width: 38px;
    padding: 9px 12px;
}

.pagination > li:first-child > a,
.pagination > li:first-child > span,
.pagination > li:last-child > a,
.pagination > li:last-child > span { border-radius: var(--hp-radius-sm); }

.pagination > .active > a,
.pagination > .active > span { background: var(--hp-primary); border-color: var(--hp-primary); }

.modal-content {
    border: 1px solid var(--hp-border);
    border-radius: var(--hp-radius-lg);
    box-shadow: 0 24px 70px rgba(12, 38, 53, .2);
    overflow: hidden;
}

.modal-header,
.modal-footer { border-color: var(--hp-border); }

/* Authentication: a quiet, focused entry screen using the native WHMCS form. */
body:has(#main-body .logincontainer) {
    background: #fff !important;
}

body:has(#main-body .logincontainer) #header {
    background: rgba(255, 255, 255, .96);
    border-bottom: 1px solid rgba(220, 230, 234, .9);
    position: relative;
    z-index: 2;
}

body:has(#main-body .logincontainer) #main-menu { display: none !important; }

body:has(#main-body .logincontainer) #main-body {
    align-items: center !important;
    background:
        radial-gradient(circle at 12% 15%, rgba(0, 168, 198, .12), transparent 30%),
        radial-gradient(circle at 88% 82%, rgba(8, 124, 167, .1), transparent 28%),
        linear-gradient(180deg, #fbfdfe 0%, #f2f7f9 100%) !important;
    display: flex !important;
    min-height: calc(100vh - 122px) !important;
    padding: 54px 20px 72px !important;
    position: relative;
}

body:has(#main-body .logincontainer) #main-body::before,
body:has(#main-body .logincontainer) #main-body::after {
    content: none !important;
    display: none !important;
}

body:has(#main-body .logincontainer) #main-body > .container {
    display: block !important;
    margin: 0 auto !important;
    max-width: 480px !important;
    padding: 0 !important;
    width: 100% !important;
}

body:has(#main-body .logincontainer) .logincontainer {
    background: rgba(255, 255, 255, .98);
    border: 1px solid var(--hp-border);
    border-radius: 22px;
    box-shadow: 0 24px 70px rgba(12, 38, 53, .12);
    margin: 0 !important;
    max-width: none !important;
    overflow: hidden;
    padding: 38px 40px 40px;
    position: relative;
    width: 100% !important;
}

body:has(#main-body .logincontainer) .logincontainer::before {
    background: linear-gradient(90deg, var(--hp-primary), #00a8c6);
    content: "" !important;
    display: block !important;
    height: 4px;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
}

body:has(#main-body .logincontainer) .logincontainer .header-lined {
    margin-bottom: 30px;
    text-align: center;
}

body:has(#main-body .logincontainer) .logincontainer .header-lined h1 {
    font-size: 34px !important;
    letter-spacing: -.04em !important;
}

body:has(#main-body .logincontainer) .logincontainer .header-lined h1::before {
    content: none !important;
    display: none !important;
}

body:has(#main-body .logincontainer) .logincontainer .header-lined h1 small {
    font-size: 14px;
    margin-top: 9px;
}

body:has(#main-body .logincontainer) .logincontainer .form-group { margin-bottom: 20px; }

body:has(#main-body .logincontainer) .logincontainer label {
    display: block;
    font-size: 12px;
    margin-bottom: 8px;
}

body:has(#main-body .logincontainer) .logincontainer .form-control {
    background: #fbfdfe;
    border-color: #cbd8de;
    font-size: 15px;
    min-height: 50px;
    padding: 12px 14px;
    width: 100%;
}

body:has(#main-body .logincontainer) .logincontainer .form-control:focus {
    background: #fff;
}

body:has(#main-body .logincontainer) .logincontainer .checkbox {
    color: var(--hp-muted);
    margin-bottom: 22px;
}

body:has(#main-body .logincontainer) .logincontainer .btn-primary {
    font-size: 14px;
    min-height: 48px;
    width: 100%;
}

body:has(#main-body .logincontainer) .logincontainer a {
    color: var(--hp-primary-hover);
    font-weight: 650;
}

/* Dashboard: keep live WHMCS counts and panels while presenting a SaaS workspace. */
#main-body .client-home-panels {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

#main-body .client-home-panels > .row {
    display: contents;
}

#main-body .client-home-panels::before,
#main-body .client-home-panels::after,
#main-body .client-home-panels > .row::before,
#main-body .client-home-panels > .row::after {
    content: none !important;
    display: none !important;
}

#main-body .client-home-panels > .panel,
#main-body .client-home-panels > [class*="col-"],
#main-body .client-home-panels > .row > [class*="col-"] {
    float: none;
    margin: 0;
    width: auto;
}

#main-body .client-home-panels > [class*="col-"],
#main-body .client-home-panels > .row > [class*="col-"] {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

#main-body .client-home-panels > [class*="col-"] > .panel,
#main-body .client-home-panels > .row > [class*="col-"] > .panel {
    flex: 0 0 auto;
    height: auto;
    margin: 0;
}

#main-body .client-home-panels > [class*="col-sm-12"],
#main-body .client-home-panels > [class*="col-md-12"],
#main-body .client-home-panels > .row > [class*="col-sm-12"],
#main-body .client-home-panels > .row > [class*="col-md-12"] {
    grid-column: 1 / -1;
}

#main-body .client-home-panels .panel-heading {
    background: #fff !important;
    min-height: 58px;
}

#main-body .client-home-panels .panel-title {
    font-size: 15px;
    letter-spacing: -.01em;
}

#main-body .client-home-panels .panel-footer {
    background: #fbfcfd;
    border-top: 1px solid var(--hp-border);
    padding: 13px 18px;
}

#main-body .tiles .tile {
    overflow: hidden;
    position: relative;
}

#main-body .tiles .tile::after {
    background: rgba(255, 255, 255, .14);
    border-radius: 999px;
    content: "";
    height: 72px;
    position: absolute;
    right: -28px;
    top: -28px;
    width: 72px;
}

#main-body .tiles .tile:hover {
    border-color: #3b82df !important;
    box-shadow: 0 16px 34px rgba(11, 99, 206, .28) !important;
    transform: translateY(-2px);
}

/* Keep native dashboard actions readable against branded surfaces. */
#main-body .sidebar .panel-footer .btn,
#main-body .client-home-panels .panel-footer .btn-primary,
#main-body .client-home-panels .panel-footer .btn-success {
    background: var(--hp-primary) !important;
    border-color: var(--hp-primary) !important;
    color: #fff !important;
    opacity: 1 !important;
}

#main-menu .navbar-nav > li:last-child > a,
#main-menu .navbar-nav > li:last-child > a:hover,
#main-menu .navbar-nav > li:last-child > a:focus {
    background: var(--hp-primary) !important;
    color: #fff !important;
}

/* Win over the older portal theme's highly-specific signed-in selectors. */
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li:last-child > a,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li:last-child > a:hover,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li:last-child > a:focus,
body:not(:has(.logincontainer)):not(:has(#registration)) #header .top-nav a[href*="logout"] {
    background: var(--hp-primary) !important;
    border-color: var(--hp-primary) !important;
    color: #fff !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-body .sidebar .panel-footer .btn {
    background: var(--hp-primary) !important;
    border-color: var(--hp-primary) !important;
    color: #fff !important;
    opacity: 1 !important;
}

/* Store: reduce excess mobile height while preserving product-generated content. */
#order-standard_cart #products .product { min-height: 0 !important; }

#order-standard_cart #products .product-desc {
    min-height: 250px;
    padding-bottom: 82px;
}

#order-standard_cart #products .product-pricing { top: 88px; }

#order-standard_cart #products .btn-order-now { bottom: 20px; }

/* Responsive behavior and touch targets. */
@media (min-width: 992px) {
    #main-body .sidebar:not(.sidebar-secondary) {
        position: sticky;
        top: 18px;
    }
}

@media (max-width: 1199px) {
    .hp-stat-grid,
    #main-body .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
    #main-body > .container { padding-top: 26px; }
    #main-body .sidebar { position: static; }
    #main-menu .navbar-toggle { border-color: var(--hp-border); min-height: 44px; min-width: 44px; }
    #main-menu .navbar-toggle .icon-bar { background: var(--hp-text); }
}

@media (max-width: 767px) {
    #header { min-height: 64px; }
    #header .top-nav > li > a { min-height: 40px; }

    #main-menu .navbar-collapse {
        border: 0;
        box-shadow: none;
        max-height: calc(100vh - 130px);
        overflow-y: auto;
        padding-bottom: 12px;
    }

    #main-menu .navbar-nav > li > a {
        margin: 2px 8px !important;
        min-height: 44px;
        padding: 12px 14px !important;
    }

    #main-body > .container { padding: 22px 14px 36px; }

    .hp-page-header {
        align-items: stretch;
        flex-direction: column;
        gap: 14px;
    }

    .hp-stat-grid,
    #main-body .tiles { grid-template-columns: 1fr; }

    #main-body .client-home-panels { grid-template-columns: 1fr; }

    body:has(#main-body .logincontainer) #main-body {
        min-height: calc(100vh - 110px) !important;
        padding: 30px 14px 46px !important;
    }

    body:has(#main-body .logincontainer) .logincontainer {
        border-radius: 18px;
        padding: 32px 22px 30px;
    }

    body:has(#main-body .logincontainer) .logincontainer .header-lined h1 {
        font-size: 30px !important;
    }

    /* Ticket conversation headers: prevent avatar, identity and date overlap. */
    #main-body .ticket-reply .date {
        display: block !important;
        float: none !important;
        font-size: 11px;
        line-height: 1.45;
        padding: 12px 14px 0 !important;
        text-align: left !important;
        width: 100% !important;
    }

    #main-body .ticket-reply .user {
        align-items: center;
        display: grid !important;
        gap: 3px 10px;
        grid-template-columns: 36px minmax(0, 1fr);
        grid-template-rows: auto auto;
        min-height: 64px;
        padding: 8px 14px 12px !important;
        width: 100% !important;
    }

    #main-body .ticket-reply .user > .fa,
    #main-body .ticket-reply .user > .fas,
    #main-body .ticket-reply .user > .far {
        align-self: center;
        font-size: 30px !important;
        grid-column: 1;
        grid-row: 1 / 3;
        margin: 0 !important;
        width: 36px !important;
    }

    #main-body .ticket-reply .user .name {
        align-items: center;
        display: flex !important;
        flex-wrap: wrap;
        gap: 5px;
        grid-column: 2;
        grid-row: 1;
        line-height: 1.35;
        min-width: 0;
    }

    #main-body .ticket-reply .user .type {
        display: block !important;
        font-size: 11px;
        grid-column: 2;
        grid-row: 2;
        line-height: 1.35;
        min-width: 0;
    }

    #main-body .ticket-reply .user .label {
        margin: 0 !important;
        white-space: nowrap;
    }

    #main-body .ticket-reply .message {
        padding: 15px 14px !important;
    }

    #main-body table.table { border-radius: var(--hp-radius); }
    #main-body .table-responsive { border: 0; margin-bottom: 20px; overflow-x: auto; -webkit-overflow-scrolling: touch; }

    #main-body .panel-body,
    .hp-card { padding: 18px; }

    .btn { min-height: 44px; }

    #order-standard_cart #products .product-desc {
        min-height: 0;
        padding: 20px 22px 14px;
    }

    #order-standard_cart #products .product-pricing { padding-bottom: 14px; }
    #order-standard_cart #products .btn-order-now { min-height: 44px; }
}

@media (max-width: 430px) {
    body:not(:has(#main-body .logincontainer)) #header .logo { float: none; }
    #header .top-nav { margin-bottom: 8px; }
    #main-body .header-lined h1 { font-size: 28px !important; }
    #order-standard_cart .header-lined h1 { font-size: 28px !important; }
}

/* Signed-in navigation: a single, high-contrast application bar. */
body:not(:has(.logincontainer)):not(:has(#registration)) #header {
    background: #fff;
    border-bottom: 1px solid #e3eaf0;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #header .top-nav > li > a {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 650;
    padding: 9px 11px;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar {
    background: linear-gradient(100deg, #0b63ce 0%, #084da2 100%) !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu {
    border: 0 !important;
    box-shadow: 0 8px 20px rgba(11, 99, 206, .18) !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li > a {
    background: transparent !important;
    border: 1px solid transparent;
    border-radius: 9px !important;
    color: rgba(255, 255, 255, .92) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
    letter-spacing: -.01em;
    margin: 6px 3px !important;
    padding: 10px 13px !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li > a:hover,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li > a:focus,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li.active > a,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li.open > a {
    background: rgba(255, 255, 255, .16) !important;
    border-color: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
    transform: none !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li:last-child > a {
    background: rgba(3, 32, 77, .34) !important;
    border-color: rgba(255, 255, 255, .14) !important;
    color: #fff !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-nav > li > a .caret {
    border-top-color: currentColor;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .dropdown-menu {
    background: #fff;
    border: 0 !important;
    border-radius: 12px !important;
    box-shadow: 0 16px 34px rgba(4, 36, 90, .22) !important;
    margin-top: 3px;
    padding: 6px !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .dropdown-menu > li > a {
    border-radius: 7px;
    color: var(--hp-text) !important;
    font-weight: 650;
    padding: 10px 12px !important;
}

body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .dropdown-menu > li > a:hover,
body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .dropdown-menu > li > a:focus {
    background: var(--hp-primary-soft) !important;
    color: var(--hp-primary-hover) !important;
}

/* Registration telephone control: retain enough room for the country flag and dial code. */
#registration .intl-tel-input {
    display: block;
    width: 100%;
}

#registration .intl-tel-input input#inputPhone {
    box-sizing: border-box;
    padding-left: 104px !important;
    width: 100%;
}

#registration .intl-tel-input .country-list {
    border: 1px solid #d5e2ed;
    border-radius: 12px;
    box-shadow: 0 16px 32px rgba(12, 51, 91, .18);
    margin-top: 6px;
    max-height: 260px;
    z-index: 1060;
}

#registration .intl-tel-input .country-list .country {
    padding: 9px 12px;
}

@media (max-width: 767px) {
    body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-toggle {
        border-color: rgba(255, 255, 255, .6);
    }

    body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-toggle .icon-bar {
        background: #fff !important;
    }

    body:not(:has(.logincontainer)):not(:has(#registration)) #main-menu .navbar-collapse {
        background: #084da2;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: .01ms !important;
    }
}
