/* =========================================================================
   CloudHosti client-area design system
   Overrides hostingard.css's Bootstrap-4 primitives site-wide. Loaded last
   (see includes/head.tpl), so everything here cascades over the base theme
   without editing it. Tokens match assets/css/main.css / custom.css in the
   main storefront repo exactly — same blue, same font, same radii — so the
   client portal reads as the same product as cloudhosti.com.
   ========================================================================= */

:root {
  --ch-primary: #1062fe;
  --ch-primary-dark: #0e53d8;
  --ch-primary-darker: #0a3b98;
  --ch-primary-light: #dbe7ff;
  --ch-gradient: linear-gradient(115deg, rgb(97,64,146) 0%, rgb(36,67,172) 100%);

  --ch-success: #5a9c00;
  --ch-success-light: #F1FCCF;
  --ch-warning: #a3720b;
  --ch-warning-light: #FEF2D1;
  --ch-danger: #c23f16;
  --ch-danger-light: #FDE4D7;
  --ch-info: #2FD9EF;

  --ch-ink: #1d1d1f;
  --ch-body: #404040;
  --ch-muted: #6b6b6f;
  --ch-border: #e9eaec;
  --ch-surface: #ffffff;
  --ch-bg: #f7f8fa;

  --ch-radius-sm: 8px;
  --ch-radius: 12px;
  --ch-radius-lg: 16px;
  --ch-shadow: 0 4px 12px rgba(0,0,0,0.06);
  --ch-shadow-hover: 0 10px 28px rgba(0,0,0,0.10);
}

/* Dark mode — this theme has a real light/dark toggle (variables.css
   already defines a `:root[data-bs-theme="dark"]` block); every ch-*
   token below is the dark counterpart so components that reference them
   (almost everything in this file) adapt automatically instead of
   staying hardcoded to light-mode colors. Mirrors the dark values already
   used in includes/tt/hostingard/css/variables.css for consistency. */
:root[data-bs-theme="dark"] {
  --ch-primary: #1062fe;
  --ch-primary-dark: #3b82f6;
  --ch-primary-darker: #1e3a8a;
  --ch-primary-light: #0a2255;

  --ch-success: #9ae62b;
  --ch-success-light: #1f2e0a;
  --ch-warning: #f5c451;
  --ch-warning-light: #3a2c0a;
  --ch-danger: #ff8566;
  --ch-danger-light: #3a1a10;
  --ch-info: #2FD9EF;

  --ch-ink: #f8fafc;
  --ch-body: #cbd5e1;
  --ch-muted: #94a3b8;
  --ch-border: #334155;
  --ch-surface: #1e293b;
  --ch-bg: #0f172a;

  --ch-shadow: 0 4px 12px rgba(0,0,0,0.30);
  --ch-shadow-hover: 0 10px 28px rgba(0,0,0,0.40);
}

body {
  background: var(--ch-bg);
  color: var(--ch-body);
  font-family: 'Nunito', sans-serif;
}

h1, h2, h3, h4, h5, h6 { color: var(--ch-ink); font-weight: 800; }

a { color: var(--ch-primary); }
a:hover { color: var(--ch-primary-dark); }

/* -------------------- Buttons -------------------- */
.btn {
  border-radius: var(--ch-radius-sm) !important;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 0.55rem 1.1rem;
  transition: all .2s ease;
}
.btn-primary, .btn-default {
  background: var(--ch-primary) !important;
  border-color: var(--ch-primary) !important;
  color: #fff !important;
}
.btn-primary:hover, .btn-default:hover {
  background: var(--ch-primary-dark) !important;
  border-color: var(--ch-primary-dark) !important;
  box-shadow: 0 6px 18px rgba(16,98,254,0.30);
}
.btn-outline-primary {
  color: var(--ch-primary) !important;
  border-color: var(--ch-primary) !important;
}
.btn-outline-primary:hover {
  background: var(--ch-primary) !important;
  color: #fff !important;
}
.btn-success {
  background: var(--ch-success) !important;
  border-color: var(--ch-success) !important;
  color: #fff !important;
}
.btn-success:hover {
  filter: brightness(0.92);
}
.btn-sm { padding: 0.4rem 0.85rem; font-size: 0.78rem; }
.btn-link { color: var(--ch-primary); font-weight: 700; }

/* -------------------- Cards -------------------- */
.card, .mc-promo-login, .mc-promo-manage {
  border: none !important;
  border-radius: var(--ch-radius) !important;
  box-shadow: var(--ch-shadow);
  transition: box-shadow .3s ease, transform .3s ease;
}
.card:hover { box-shadow: var(--ch-shadow-hover); }
.card-header {
  background: transparent !important;
  border-bottom: 1px solid var(--ch-border) !important;
  font-weight: 700;
}
.card-title { color: var(--ch-ink); font-weight: 800; }

/* Sidebar cards (includes/sidebar.tpl) get the same treatment, gently */
.card-sidebar { border-radius: var(--ch-radius) !important; overflow: hidden; }
.card-sidebar .card-header { background: var(--ch-bg) !important; }
.card-sidebar .list-group-item.active {
  background: var(--ch-primary-light) !important;
  color: var(--ch-primary-dark) !important;
  border-color: transparent !important;
  font-weight: 700;
}
.card-sidebar .list-group-item-action:hover {
  background: var(--ch-bg) !important;
}

/* -------------------- Badges -------------------- */
.badge {
  border-radius: 50rem !important;
  font-weight: 700;
  padding: 0.35em 0.75em;
  letter-spacing: 0.2px;
}
.badge-success, .badge-active { background: var(--ch-success-light) !important; color: var(--ch-success) !important; }
.badge-warning, .badge-pending { background: var(--ch-warning-light) !important; color: var(--ch-warning) !important; }
.badge-danger, .badge-terminated, .badge-cancelled { background: var(--ch-danger-light) !important; color: var(--ch-danger) !important; }
.badge-primary { background: var(--ch-primary-light) !important; color: var(--ch-primary-dark) !important; }

/* -------------------- Alerts -------------------- */
.alert {
  border: none !important;
  border-radius: var(--ch-radius) !important;
  font-size: 0.88rem;
}
.alert-success { background: var(--ch-success-light) !important; color: #3d6b00 !important; }
.alert-warning { background: var(--ch-warning-light) !important; color: #7a5608 !important; }
.alert-danger  { background: var(--ch-danger-light) !important; color: #922c0f !important; }
.alert-info    { background: var(--ch-primary-light) !important; color: var(--ch-primary-darker) !important; }

/* -------------------- Forms -------------------- */
.form-control, .custom-select, select.form-control {
  border-radius: var(--ch-radius-sm) !important;
  border: 1.5px solid var(--ch-border) !important;
  font-family: 'Nunito', sans-serif;
  padding: 0.6rem 0.9rem;
  font-size: 0.88rem;
  background: var(--ch-surface) !important;
  color: var(--ch-ink) !important;
}
.form-control::placeholder { color: var(--ch-muted); opacity: 1; }
.form-control:focus {
  border-color: var(--ch-primary) !important;
  box-shadow: 0 0 0 3px rgba(16,98,254,0.15) !important;
}
label { font-weight: 700; font-size: 0.82rem; color: var(--ch-body); }

/* Icon-prefixed inputs (.input-group + .input-group-prepend/-append) need
   to read as ONE seamless field, not two separate rounded boxes bumping
   into each other — the icon box and the input share a single border and
   only the group's outer corners are rounded. */
.input-group {
  border-radius: var(--ch-radius-sm);
  overflow: hidden;
}
.input-group .form-control {
  border-radius: 0 !important;
  border-left: none !important;
}
.input-group .input-group-prepend:first-child ~ .form-control,
.input-group > .form-control:first-child {
  border-left: 1.5px solid var(--ch-border) !important;
}
.input-group-prepend .input-group-text,
.input-group-append .input-group-text,
.input-group .btn-reveal-pw {
  border: 1.5px solid var(--ch-border) !important;
  background: var(--ch-bg) !important;
  color: var(--ch-muted);
}
.input-group-prepend .input-group-text {
  border-right: none !important;
  border-radius: var(--ch-radius-sm) 0 0 var(--ch-radius-sm) !important;
}
.input-group-append .input-group-text,
.input-group .btn-reveal-pw {
  border-left: none !important;
  border-radius: 0 var(--ch-radius-sm) var(--ch-radius-sm) 0 !important;
}
.input-group:focus-within {
  box-shadow: 0 0 0 3px rgba(16,98,254,0.15);
  border-radius: var(--ch-radius-sm);
}
.input-group:focus-within .form-control,
.input-group:focus-within .input-group-text {
  border-color: var(--ch-primary) !important;
}

/* -------------------- Tables -------------------- */
.table { font-size: 0.88rem; }
.table thead th {
  border-bottom: 2px solid var(--ch-border) !important;
  color: var(--ch-muted);
  font-weight: 700;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}
.table td, .table th { border-top: 1px solid var(--ch-border) !important; vertical-align: middle; }
.table-list > tbody > tr:hover > td { background: var(--ch-bg) !important; }

/* -------------------- List groups -------------------- */
.list-group-item {
  border-color: var(--ch-border) !important;
}
.list-group-item-action:hover, .list-group-item-action:focus {
  background: var(--ch-bg) !important;
}

/* -------------------- Nav tabs / breadcrumb -------------------- */
.nav-tabs { border-bottom: 1px solid var(--ch-border) !important; }
.nav-tabs .nav-link {
  border: none !important;
  color: var(--ch-muted);
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 2px solid transparent !important;
  border-radius: 0 !important;
}
.nav-tabs .nav-link.active {
  color: var(--ch-primary) !important;
  border-bottom-color: var(--ch-primary) !important;
  background: transparent !important;
}
.breadcrumb {
  background: transparent !important;
  font-size: 0.82rem;
  padding-left: 0;
}

/* -------------------- Modals -------------------- */
.modal-content {
  border: none !important;
  border-radius: var(--ch-radius-lg) !important;
  box-shadow: 0 20px 60px rgba(9,26,58,0.25);
}
.modal-header { border-bottom: 1px solid var(--ch-border) !important; }
.modal-footer { border-top: 1px solid var(--ch-border) !important; }

/* -------------------- Pagination -------------------- */
.page-link {
  border-radius: var(--ch-radius-sm) !important;
  margin: 0 2px;
  border: 1.5px solid var(--ch-border) !important;
  color: var(--ch-body);
}
.page-item.active .page-link {
  background: var(--ch-primary) !important;
  border-color: var(--ch-primary) !important;
}

/* -------------------- Dropdowns -------------------- */
.dropdown-menu {
  border: none !important;
  border-radius: var(--ch-radius) !important;
  box-shadow: 0 10px 30px rgba(0,0,0,0.12);
  padding: 8px;
}
.dropdown-item { border-radius: var(--ch-radius-sm); font-size: 0.86rem; }
.dropdown-item:hover { background: var(--ch-bg) !important; }

/* =========================================================================
   New composable classes for rebuilt pages (login, dashboard, and further
   pages as they're redesigned) — not Bootstrap overrides, additive.
   ========================================================================= */

.ch-hero-gradient {
  background: var(--ch-gradient);
  position: relative;
  overflow: hidden;
}

.ch-glass-card {
  background: var(--ch-surface); /* fallback for browsers without color-mix() */
  background: color-mix(in srgb, var(--ch-surface) 94%, transparent);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  border: 1px solid color-mix(in srgb, var(--ch-surface) 60%, white 40%);
  border-radius: var(--ch-radius-lg);
  box-shadow: 0 20px 60px rgba(9,26,58,0.35);
}
[data-bs-theme="dark"] .ch-glass-card {
  border-color: rgba(255,255,255,0.12);
}

.ch-stat-card {
  background: var(--ch-surface);
  border-radius: var(--ch-radius-lg);
  padding: 22px;
  box-shadow: var(--ch-shadow);
  transition: box-shadow .3s ease, transform .3s ease;
}
.ch-stat-card:hover { box-shadow: var(--ch-shadow-hover); transform: translateY(-2px); }
.ch-stat-card { display: block !important; } /* guards against .tt-single-box's flex forcing children into a row if ever combined */

.ch-stat-icon {
  width: 38px; height: 38px;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}

.ch-promo-banner {
  background: var(--ch-gradient);
  border-radius: var(--ch-radius-lg);
  padding: 22px 28px;
  position: relative;
  overflow: hidden;
  color: #fff;
}

.ch-service-row {
  background: var(--ch-surface);
  border-radius: var(--ch-radius-lg);
  padding: 18px 22px;
  box-shadow: var(--ch-shadow);
  display: flex; align-items: center; justify-content: space-between;
  transition: box-shadow .3s ease, transform .3s ease;
}
.ch-service-row:hover { box-shadow: var(--ch-shadow-hover); transform: translateY(-2px); }

/* =========================================================================
   Shared chrome (header/nav/footer) — restyled in place rather than
   restructured: this markup carries real functionality (notifications,
   cart, language/currency switching, admin-impersonation return link,
   search) that isn't safe to rebuild without a way to test it end to end.
   ========================================================================= */

.tt-header,
[data-bs-theme="dark"] .tt-header {
  background: var(--ch-surface) !important;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  border: none !important;
}
.tt-header .tt-main-header ul li a,
[data-bs-theme="dark"] .tt-header .tt-main-header ul li a {
  font-weight: 700;
  color: var(--ch-body) !important;
  font-size: 0.88rem;
}
.tt-header .tt-main-header ul li a:hover,
.tt-header .tt-main-header ul li a.active {
  color: var(--ch-primary) !important;
}
.tt-header .logo-img { height: 30px; }

/* Page-title banner (e.g. "myDashboard") — use the signature diagonal
   gradient instead of hostingard's flat solid blue, matching the
   login/dashboard hero treatment. */
.tt-page-header {
  background: var(--ch-gradient) !important;
}

.tt-cart-badge {
  background: var(--ch-primary) !important;
}
.tt-notification .tt-circle {
  background: var(--ch-danger) !important;
}

footer#footer.tt-footer {
  background: #14151a !important;
}
.tt-footer-widget h6 { font-weight: 800; }
.tt-footer-menu li a {
  font-size: 0.86rem;
  color: rgba(255,255,255,0.7) !important;
}
.tt-footer-menu li a:hover { color: #fff !important; }
.tt-footer-bottom {
  background: #0e0f13 !important;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.copyright { color: rgba(255,255,255,0.6); font-size: 0.84rem; }

/* Language/currency chooser & ajax modals share .modal-content, already
   covered above; a couple of finer touches specific to these: */
.modal-localisation .item-selector .item {
  border-radius: var(--ch-radius-sm);
  border: 1.5px solid var(--ch-border);
  padding: 10px 14px;
  display: block;
  text-align: center;
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--ch-body);
  margin-bottom: 10px;
}
.modal-localisation .item-selector .item.active,
.modal-localisation .item-selector .item:hover {
  border-color: var(--ch-primary);
  background: var(--ch-primary-light);
  color: var(--ch-primary-dark);
}

.btn-return-to-admin {
  background: var(--ch-danger) !important;
  color: #fff !important;
  border-radius: var(--ch-radius-sm) !important;
}
