/*
 * ENTEGRA public pages (landing, pricing, business registration).
 *
 * Loaded ONLY by layouts/entegra/public.blade.php, last in the cascade:
 *   css/tailwind/app.css -> tabler.min.css -> tabler-icons -> entegra-tabler.css -> THIS
 *
 * Two jobs:
 *  1. Style the public shell (navbar / hero / footer).
 *  2. Teach Bootstrap 5 how to render the Bootstrap 3 markup inside shared
 *     partials these pages reuse. business.partials.register_form is also
 *     included by Modules/Superadmin/.../business/create.blade.php, which still
 *     runs on Bootstrap 3, so the partial itself must not be rewritten.
 */

:root {
  --entegra-public-accent: #206bc4;
  --entegra-public-accent-dark: #1a5493;
  --entegra-public-surface: #ffffff;
  --entegra-public-border: #e6e8ee;
  --entegra-public-text: #1a2234;
  --entegra-public-muted: #667382;
}

body.entegra-public {
  min-height: 100vh;
  background: #f5f7fb;
  color: var(--entegra-public-text);
}

/* ============================================================
   Navbar
   ============================================================ */
.entegra-public .entegra-public-navbar {
  position: relative;
  min-height: 4.25rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--entegra-public-border);
  background: var(--entegra-public-surface);
}

.entegra-public .entegra-public-navbar > .container-xl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.entegra-public .entegra-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--entegra-public-text);
  text-decoration: none;
}

.entegra-public .entegra-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--entegra-public-accent);
  color: #fff;
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.entegra-public .entegra-brand-name {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.entegra-public .entegra-brand-sub {
  display: block;
  color: var(--entegra-public-muted);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.entegra-public .entegra-public-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.entegra-public .entegra-public-link {
  color: var(--entegra-public-text);
  font-weight: 500;
  text-decoration: none;
}

.entegra-public .entegra-public-link:hover {
  color: var(--entegra-public-accent);
}

/* ============================================================
   Page body + footer
   ============================================================ */
.entegra-public .entegra-public-main {
  flex: 1 1 auto;
  padding: 2.5rem 0 3rem;
}

.entegra-public .entegra-public-footer {
  padding: 1.25rem 0;
  border-top: 1px solid var(--entegra-public-border);
  background: var(--entegra-public-surface);
  color: var(--entegra-public-muted);
  font-size: 0.875rem;
  text-align: center;
}

/* ============================================================
   Hero (landing)
   ============================================================ */
.entegra-public .entegra-hero {
  padding: 3rem 0 2rem;
  text-align: center;
}

.entegra-public .entegra-hero-title {
  margin-bottom: 0.75rem;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.entegra-public .entegra-hero-lead {
  max-width: 42rem;
  margin: 0 auto 1.75rem;
  color: var(--entegra-public-muted);
  font-size: 1.05rem;
}

.entegra-public .entegra-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.entegra-public .entegra-feature-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: 0.85rem;
  border-radius: 0.75rem;
  background: rgba(32, 107, 196, 0.1);
  color: var(--entegra-public-accent);
  font-size: 1.4rem;
}

/* ============================================================
   Pricing
   ============================================================ */
.entegra-public .entegra-pricing-head {
  margin-bottom: 2rem;
  text-align: center;
}

.entegra-public .entegra-billing-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--entegra-public-border);
  border-radius: 999px;
  background: var(--entegra-public-surface);
  font-size: 0.9rem;
  font-weight: 500;
}

/* The AJAX-injected cards come from a partial shared with the in-app
   subscription page, so they are laid out - not restyled - from here.
   Bootstrap 3 columns float; Bootstrap 5 columns are flex items needing a
   .row parent, which the injected fragment does not provide. */
.entegra-public #packages {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  justify-content: center;
  gap: 1.25rem;
}

.entegra-public #packages > .price_card {
  display: flex;
  float: none;
  width: 100%;
  max-width: 22rem;
  padding: 0;
}

.entegra-public #packages > .price_card > div {
  width: 100%;
}

/* package_card.blade.php wraps its feature list in `tw-text-white`, which was
   written for a dark background - on the white card it renders white-on-white,
   which is why the card body looked empty. Scoped to the public pages so the
   in-app subscription screen keeps whatever it renders today. */
.entegra-public .price_card .tw-text-white {
  color: var(--entegra-public-text);
}

.entegra-public .price_card .tw-text-white .fa,
.entegra-public .price_card .tw-text-white [class*='fa-'] {
  color: #2fb344;
}

.entegra-public #packages:empty::after {
  display: block;
  padding: 3rem 1rem;
  color: var(--entegra-public-muted);
  content: attr(data-empty-text);
  text-align: center;
}

/* ============================================================
   Font Awesome -> Tabler icon mapping
   Shared legacy partials mark their icons up as `fa fa-*`, but the Font Awesome
   stylesheet lives inside css/vendor.css, which also carries Bootstrap 3 - so
   these pages cannot load it without fighting Tabler. The Tabler icon font is
   already loaded here, so the handful of glyphs those partials actually use are
   re-pointed at their Tabler equivalents. Codepoints taken from
   vendor/tabler/dist/icons/css/tabler-icons.min.css (Tabler Icons 3.46.0).
   ============================================================ */
.entegra-public .fa,
.entegra-public .fas,
.entegra-public .far,
.entegra-public [class^='fa-'],
.entegra-public [class*=' fa-'] {
  display: inline-block;
  font-family: 'tabler-icons' !important;
  font-style: normal;
  font-weight: 400;
  font-variant: normal;
  line-height: 1;
  text-transform: none;
  speak: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.entegra-public .fa-check::before { content: '\ea5e'; }
.entegra-public .fa-suitcase::before { content: '\ea46'; }
.entegra-public .fa-calendar::before { content: '\ea53'; }
.entegra-public .fa-money-bill-alt::before { content: '\ea55'; }
.entegra-public .fa-globe::before { content: '\eb54'; }
.entegra-public .fa-phone::before { content: '\eb09'; }
.entegra-public .fa-map-marker::before { content: '\eae8'; }
.entegra-public .fa-clock::before { content: '\ea70'; }
.entegra-public .fa-info::before { content: '\eac5'; }
.entegra-public .fa-calculator::before { content: '\eb80'; }
.entegra-public .fa-user::before { content: '\eb4d'; }
.entegra-public .fa-envelope::before { content: '\eae5'; }
.entegra-public .fa-lock::before { content: '\eae2'; }

/* ============================================================
   Bootstrap 3 form compatibility (business registration)
   ============================================================ */
.entegra-public [class^='col-md-'],
.entegra-public [class*=' col-md-'],
.entegra-public [class^='col-xs-'],
.entegra-public [class*=' col-xs-'] {
  float: left;
  padding-right: 0.75rem;
  padding-left: 0.75rem;
}

@media (max-width: 767.98px) {
  .entegra-public [class^='col-md-'],
  .entegra-public [class*=' col-md-'] {
    float: none;
    width: 100%;
  }
}

.entegra-public .clearfix::after {
  display: block;
  clear: both;
  content: '';
}

/* The form groups its fields with <fieldset><legend>. Bootstrap 5 renders a
   legend at ~1.5rem and floats it full-width, which made "Business details:"
   tower over the fields it labels. */
.entegra-public fieldset {
  min-width: 0;
  margin-bottom: 0.5rem;
  padding: 0;
  border: 0;
}

.entegra-public legend {
  float: none;
  width: auto;
  margin-bottom: 1rem;
  padding: 0;
  color: var(--entegra-public-text);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
}

.entegra-public .form-group {
  margin-bottom: 1rem;
}

/* ---------- bootstrap-fileinput (login.js initialises #business_logo) ----------
   Its stylesheet is inside css/vendor.css; without it the plugin's chrome
   (preview pane, Remove / Cancel, the Browse button) rendered as stacked blocks. */
.entegra-public .file-input {
  display: block;
  width: 100%;
}

.entegra-public .file-preview {
  display: none;
}

/* Bootstrap 3's `.hide` utility does not exist in Bootstrap 5 (it became
   `.d-none`), so legacy partials that hide things with it - the file plugin's
   upload progress bar and its Cancel button, for two - stayed visible. */
.entegra-public .hide {
  display: none !important;
}

.entegra-public .file-input .file-caption-main {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

.entegra-public .file-input .file-caption {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 2.375rem;
  padding: 0 0.75rem;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-radius: 0.375rem 0 0 0.375rem;
  background: #fff;
}

.entegra-public .file-input .file-caption-name {
  display: block;
  width: 100%;
  font-size: 0.875rem;
  color: var(--entegra-public-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.entegra-public .file-input .input-group-btn {
  display: flex;
  flex: 0 0 auto;
}

.entegra-public .file-input .fileinput-remove {
  height: 2.375rem;
  padding: 0 0.75rem;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-left: 0;
  border-radius: 0;
  background: #f6f8fb;
  color: var(--entegra-public-muted);
  font-size: 0.875rem;
}

.entegra-public .file-input .btn-file {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  height: 2.375rem;
  padding: 0 0.9rem;
  border: 1px solid var(--entegra-public-accent);
  border-radius: 0 0.375rem 0.375rem 0;
  background: var(--entegra-public-accent);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  overflow: hidden;
}

.entegra-public .file-input .btn-file:hover {
  background: var(--entegra-public-accent-dark);
  border-color: var(--entegra-public-accent-dark);
}

/* The plugin keeps a real <input type=file> inside the button for the click
   target; it must not push the label around. */
.entegra-public .file-input .btn-file input[type='file'] {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  cursor: pointer;
}

.entegra-public .file-input .btn-file {
  position: relative;
}

.entegra-public .form-group > label,
.entegra-public .control-label {
  display: inline-block;
  margin-bottom: 0.25rem;
  font-size: 0.875rem;
  font-weight: 500;
}

.entegra-public .help-block {
  display: block;
  margin-top: 0.25rem;
  color: #d63939;
  font-size: 0.8125rem;
}

.entegra-public .has-error .form-control,
.entegra-public .has-error .input-group-addon {
  border-color: #d63939;
}

/* Bootstrap 5 renamed .input-group-addon to .input-group-text, and the
   registration form pairs every field with an icon addon. */
.entegra-public .input-group {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
}

.entegra-public .input-group > .form-control,
.entegra-public .input-group > .form-select,
.entegra-public .input-group > select {
  flex: 1 1 auto;
  min-width: 0;
}

/* If a public page ever does initialise select2 inside an .input-group, its
   generated .select2-container is not a .form-control/.form-select/select
   and so would not match the flex rule above. Kept minimal and deliberate:
   business/register does NOT use select2 (see the comment in that view). */
.entegra-public .input-group > .select2-container {
  flex: 1 1 auto;
  min-width: 0;
}

.entegra-public .input-group-addon {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 2.75rem;
  padding: 0.4375rem 0.75rem;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-right: 0;
  border-radius: 0.375rem 0 0 0.375rem;
  background: #f6f8fb;
  color: var(--entegra-public-muted);
  font-size: 0.9375rem;
  line-height: 1;
  white-space: nowrap;
}

.entegra-public .input-group > .input-group-addon + .form-control,
.entegra-public .input-group > .input-group-addon + .form-select,
.entegra-public .input-group > .input-group-addon + select,
.entegra-public .input-group > .input-group-addon + .select2-container .select2-selection {
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
}

.entegra-public select.form-control {
  display: block;
  width: 100%;
  padding: 0.4375rem 2.25rem 0.4375rem 0.75rem;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-radius: 0.375rem;
  background-color: #fff;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23667382' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  font-size: 0.875rem;
  appearance: none;
}

.entegra-public textarea.form-control {
  min-height: 5rem;
}

.entegra-public .checkbox,
.entegra-public .radio {
  display: block;
  margin: 0.5rem 0;
}

.entegra-public .checkbox label,
.entegra-public .radio label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0;
  font-size: 0.875rem;
  font-weight: 400;
}

.entegra-public .checkbox input[type='checkbox'],
.entegra-public .radio input[type='radio'] {
  width: 1rem;
  height: 1rem;
  margin: 0;
  flex: 0 0 auto;
}

/* select2 keeps the legacy skin; align its height with Tabler's inputs. */
.entegra-public .select2-container .select2-selection--single {
  height: 2.375rem;
  border: 1px solid var(--tblr-border-color, #dadfe5);
  border-radius: 0.375rem;
}

.entegra-public .select2-container .select2-selection--single .select2-selection__rendered {
  line-height: 2.25rem;
}

.entegra-public .select2-container .select2-selection--single .select2-selection__arrow {
  height: 2.25rem;
}

/* ============================================================
   bootstrap-datepicker (used by .start-date-picker via public/js/app.js)
   Its stylesheet also lives in css/vendor.css, which - same as the wizard
   below - cannot be loaded next to Tabler (full Bootstrap 3). These rules
   are the .datepicker-scoped subset of vendor.css only; nothing here
   touches .form-control/.input-group/.btn etc., so it can't fight Tabler.
   The floating position/box-shadow of the popup itself comes from
   Bootstrap 5's .dropdown-menu (bootstrap-datepicker adds that class too),
   which Tabler already styles correctly.
   ============================================================ */
.datepicker {
  padding: 4px;
  border-radius: 4px;
  direction: ltr;
}
.datepicker-dropdown:before,
.datepicker-dropdown:after {
  content: '';
  display: inline-block;
  position: absolute;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
}
.datepicker-dropdown:before {
  border-bottom: 7px solid rgba(0, 0, 0, 0.2);
  top: -7px;
}
.datepicker-dropdown:after {
  border-left-width: 6px;
  border-right-width: 6px;
  border-bottom: 6px solid #fff;
  top: -6px;
}
.datepicker table {
  margin: 0;
  user-select: none;
}
.datepicker td,
.datepicker th {
  text-align: center;
  width: 30px;
  height: 30px;
  border-radius: 4px;
  border: none;
}
.datepicker table tr td.day:hover,
.datepicker table tr td.day.focused {
  background: #eee;
  cursor: pointer;
}
.datepicker table tr td.new,
.datepicker table tr td.old {
  color: #999;
}
.datepicker table tr td.disabled,
.datepicker table tr td.disabled:hover {
  background: none;
  color: #999;
  cursor: default;
}
.datepicker table tr td.today,
.datepicker table tr td.today:hover {
  background-color: #fde19a;
  border-color: #fbed50;
  color: #000;
}
.datepicker table tr td.range,
.datepicker table tr td.range:hover {
  background: #eee;
  border-radius: 0;
}
.datepicker table tr td.selected,
.datepicker table tr td.selected:hover,
.datepicker table tr td.active,
.datepicker table tr td.active:hover {
  background-color: var(--tblr-primary, #206bc4);
  color: #fff;
}
.datepicker .datepicker-switch {
  width: 145px;
}
.datepicker .datepicker-switch,
.datepicker .next,
.datepicker .prev,
.datepicker tfoot tr th {
  cursor: pointer;
}
.datepicker .datepicker-switch:hover,
.datepicker .next:hover,
.datepicker .prev:hover,
.datepicker tfoot tr th:hover {
  background: #eee;
}
.datepicker .next.disabled,
.datepicker .prev.disabled {
  visibility: hidden;
}

/* ============================================================
   Registration wizard (jQuery Steps, driven by public/js/login.js)
   Its stylesheet lives in css/vendor.css, which also carries Bootstrap 3 and
   therefore cannot be loaded next to Tabler. The generated DOM is
   .wizard > .steps > ul > li[.current|.done|.disabled] > a > .number
   .wizard > .content > .title + .body
   .wizard > .actions > ul > li > a
   ============================================================ */
.entegra-public .wizard {
  display: block;
  width: 100%;
  overflow: hidden;
}

.entegra-public .wizard ul {
  padding: 0;
  margin: 0;
  list-style: none !important;
}

.entegra-public .wizard > .steps {
  position: relative;
  display: block;
  width: 100%;
  margin-bottom: 1.5rem;
}

.entegra-public .wizard > .steps .current-info {
  position: absolute;
  left: -999em;
}

.entegra-public .wizard > .steps > ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding-left: 0;
}

.entegra-public .wizard > .steps > ul > li {
  /* equal thirds regardless of label length; min-width:0 stops the basis plus
     the gap from overflowing the card and clipping the last step */
  flex: 1 1 0;
  min-width: 0;
  float: none;
}

.entegra-public .wizard > .steps > ul > li > a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--entegra-public-border);
  border-radius: 0.5rem;
  background: #f6f8fb;
  color: var(--entegra-public-muted);
  font-weight: 500;
  text-decoration: none;
}

.entegra-public .wizard > .steps > ul > li > a .number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.6rem;
  height: 1.6rem;
  flex: 0 0 auto;
  border-radius: 999px;
  background: #dfe3ea;
  color: var(--entegra-public-text);
  font-size: 0.8125rem;
  font-weight: 700;
}

.entegra-public .wizard > .steps > ul > li.current > a {
  border-color: var(--entegra-public-accent);
  background: var(--entegra-public-accent);
  color: #fff;
}

.entegra-public .wizard > .steps > ul > li.current > a .number {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

.entegra-public .wizard > .steps > ul > li.done > a {
  border-color: rgba(47, 179, 68, 0.35);
  background: rgba(47, 179, 68, 0.1);
  color: #1f7a33;
}

.entegra-public .wizard > .steps > ul > li.done > a .number {
  background: #2fb344;
  color: #fff;
}

.entegra-public .wizard > .content {
  position: relative;
  display: block;
  min-height: 12rem;
}

.entegra-public .wizard > .content > .title {
  position: absolute;
  left: -999em;
}

.entegra-public .wizard > .content > .body {
  display: block;
  width: 100%;
}

.entegra-public .wizard > .actions {
  display: block;
  width: 100%;
  margin-top: 1.5rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--entegra-public-border);
  text-align: right;
}

.entegra-public .wizard > .actions > ul {
  display: inline-flex;
  gap: 0.5rem;
}

.entegra-public .wizard > .actions > ul > li {
  float: none;
}

.entegra-public .wizard > .actions > ul > li > a {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.1rem;
  border: 1px solid var(--entegra-public-accent);
  border-radius: 0.375rem;
  background: var(--entegra-public-accent);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
}

.entegra-public .wizard > .actions > ul > li > a:hover {
  background: var(--entegra-public-accent-dark);
  border-color: var(--entegra-public-accent-dark);
  color: #fff;
}

.entegra-public .wizard > .actions > ul > li.disabled > a,
.entegra-public .wizard > .actions > ul > li[aria-disabled='true'] > a {
  border-color: var(--entegra-public-border);
  background: #f6f8fb;
  color: var(--entegra-public-muted);
  pointer-events: none;
}

.entegra-public .entegra-register-card .card-body {
  padding: 1.5rem;
}

@media (min-width: 768px) {
  .entegra-public .entegra-register-card .card-body {
    padding: 2rem;
  }
}
