
:root {
  --app-bg: #f4f6f8;
  --app-surface: #ffffff;
  --app-surface-soft: #eef3f7;
  --app-primary: #4b7ea6;
  --app-primary-dark: #2e5676;
  --app-text: #22313f;
  --app-muted: #667685;
  --app-border: #d7e1e8;
  --app-accent: #b8cad8;
  --nav-bg: #d7e1ea;
}

html, body { height: 100%; }
body.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--app-bg);
  color: var(--app-text);
}
.app-main { flex: 1 0 auto; }

a { color: var(--app-primary-dark); text-decoration: none; }
a:hover { color: var(--app-primary); }

.app-navbar {
  background: var(--nav-bg);
  backdrop-filter: blur(10px);
}
.app-footer {
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  margin-top: auto;
}

.navbar-toggler { border-color: var(--app-border); }
.navbar-toggler:focus { box-shadow: 0 0 0 .2rem rgba(75,126,166,.18); }
.navbar-toggler-icon { filter: invert(32%) sepia(15%) saturate(815%) hue-rotate(164deg) brightness(94%) contrast(88%); }

.brand-logo {
  width: 240px;
  height: 100px;
  object-fit: contain;
  display: block;
  background: transparent;
}
.brand-subtitle {
  font-size: .86rem;
  color: var(--app-muted);
  line-height: 1.1;
  font-weight: 600;
  white-space: nowrap;
}
.footer-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
  display: block;
  opacity: .95;
}

.footer-brand-line {
  color: var(--app-muted);
  font-weight: 500;
}

.footer-links a {
  color: var(--app-muted);
  font-weight: 500;
}

.footer-links a:hover {
  color: var(--app-primary-dark);
}
.app-nav-link {
  color: var(--app-muted);
  font-weight: 500;
  padding: .45rem .7rem !important;
}
.app-nav-link:hover { color: var(--app-primary-dark); }

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top right, rgba(75,126,166,.16), transparent 34%),
    linear-gradient(135deg, #f4f7f9 0%, #e5edf3 56%, #dce7ee 100%);
  color: var(--app-text);
  border-radius: 1.5rem;
  border: 1px solid var(--app-border);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(255,255,255,.72), rgba(255,255,255,.18));
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-logo {
  width: min(100%, 540px);
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 18px rgba(34,49,63,.08));
}

.hero-kicker {
  letter-spacing: .02em;
  text-transform: uppercase;
  font-size: .78rem;
}

.feature-summary-card {
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(8px);
}

.feature-card {
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 36px rgba(34,49,63,.12) !important;
  border-color: #bfd0dd !important;
}

.feature-image {
  width: 100%;
  height: 270px;
  object-fit: cover;
  display: block;
  transition: transform .35s ease, filter .35s ease;
}

.feature-card:hover .feature-image {
  transform: scale(1.035);
  filter: saturate(1.03) contrast(1.02);
}

.feature-card .card-body {
  background: linear-gradient(180deg, #ffffff, #f7fafc);
}

.feature-icon {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--app-surface-soft);
  color: var(--app-primary-dark);
  font-weight: 700;
  border: 1px solid var(--app-border);
  margin-bottom: .85rem;
}

.app-card, .plan-card, .card {
  border-radius: 1rem !important;
  border: 1px solid var(--app-border) !important;
  box-shadow: 0 10px 25px rgba(34,49,63,.06) !important;
}

.qr-preview {
  max-width: 220px;
  border: 1px solid var(--app-border);
  border-radius: .75rem;
  padding: .5rem;
  background: white;
}

.file-card { border-radius: 1rem; }

.btn-primary {
  background: var(--app-primary);
  border-color: var(--app-primary);
}
.btn-primary:hover,
.btn-primary:focus {
  background: var(--app-primary-dark);
  border-color: var(--app-primary-dark);
}
.btn-outline-primary {
  color: var(--app-primary-dark);
  border-color: var(--app-primary);
}
.btn-outline-primary:hover {
  background: var(--app-primary);
  border-color: var(--app-primary);
}
.btn-soft {
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  color: var(--app-text);
}
.btn-soft:hover {
  background: #e2ebf2;
  border-color: #c7d6e2;
}

.badge-soft {
  background: var(--app-surface-soft);
  color: var(--app-primary-dark);
  border: 1px solid var(--app-border);
}

.table thead th {
  color: var(--app-muted);
  font-weight: 600;
  border-bottom-color: var(--app-border);
}
.table tbody td {
  border-color: #e8eef2;
}

.form-card .card-body,
.app-form .card-body {
  padding: 2rem;
}

.form-label {
  font-weight: 600;
  color: var(--app-text);
  margin-bottom: .45rem;
}

.form-control,
.form-select {
  min-height: 48px;
  border-radius: .8rem;
  border: 1px solid var(--app-border);
  background: #fbfcfd;
  padding: .8rem .95rem;
  color: var(--app-text);
}
textarea.form-control { min-height: 120px; }
.form-control:focus,
.form-select:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 .2rem rgba(75,126,166,.15);
  background: white;
}
.form-text { color: var(--app-muted); }
.invalid-feedback.d-block { font-size: .9rem; }

.form-check {
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: .9rem;
  padding: .9rem 1rem .9rem 2.5rem;
}
.form-check-input {
  margin-top: .25rem;
}

.page-intro {
  max-width: 760px;
}
.muted-panel {
  background: var(--app-surface-soft);
  border: 1px solid var(--app-border);
  border-radius: 1rem;
}
.app-alert {
  border: 0;
  border-radius: .9rem;
}
.list-check li { margin-bottom: .55rem; }
.section-title {
  font-size: 1.9rem;
  font-weight: 700;
}

@media (max-width: 991.98px) {
  .brand-logo {
    width: 180px;
    height: 75px;
  }
  .feature-image {
    height: 220px;
  }
  .hero {
    border-radius: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .feature-card,
  .feature-image {
    transition: none;
  }
  .feature-card:hover {
    transform: none;
  }
  .feature-card:hover .feature-image {
    transform: none;
  }
}


.link-copy {
  display: flex;
  gap: .65rem;
  flex-wrap: wrap;
}

.link-copy .form-control {
  flex: 1 1 240px;
}

.dropzone-upload {
  border: 2px dashed #bfd0dd;
  background: #f9fbfc;
  border-radius: 1rem;
  padding: 1.15rem;
  text-align: center;
  cursor: pointer;
  transition: all .2s ease;
}

.dropzone-upload:hover,
.dropzone-upload.is-dragover {
  border-color: var(--app-primary);
  background: #eef5fa;
}

.dropzone-label {
  display: block;
  font-weight: 600;
  color: var(--app-text);
}

.dropzone-help {
  color: var(--app-muted);
  font-size: .9rem;
  margin-top: .35rem;
}

.folder-card {
  border: 1px solid var(--app-border);
  border-radius: 1rem;
  padding: 1rem;
  background: var(--app-surface-soft);
}


.testimonial-card {
  transition: transform .2s ease, box-shadow .2s ease;
}

.testimonial-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(34,49,63,.10) !important;
}

.star-rating {
  color: #d4a94f;
  letter-spacing: .08em;
  font-size: 1.05rem;
}

.testimonial-name {
  font-weight: 700;
  color: var(--app-text);
}

.testimonial-role {
  color: var(--app-muted);
  font-size: .92rem;
}

/* Electrical nameplate module */
.nameplate-card {
  border: 2px solid #1f1f1f !important;
  min-width: 860px;
  background: #fff;
}

.nameplate-header h2 {
  font-size: 2rem;
  color: #111;
}

.nameplate-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  flex-wrap: wrap;
}

.nameplate-logo-block {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.nameplate-company-logo {
  width: 260px;
  max-width: 100%;
  height: auto;
  display: block;
}

.website-url {
  font-size: 1rem;
  text-align: center;
  width: 100%;
  margin-top: 4px;
  color: #666;
}

.qr-wrapper {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 170px;
}

.qr-note {
  margin-top: 6px;
  font-size: .78rem;
  line-height: 1.2;
}

.nameplate-qr-code {
  width: 120px;
  height: 120px;
  border: 1px solid #ccc;
  padding: 3px;
  background: #fff;
}

.nameplate-table th {
  width: 38%;
  background: #e9ecef;
  font-weight: 700;
  border: 2px solid #707070 !important;
}

.nameplate-table td,
.nameplate-table th {
  padding: .75rem 1rem;
  font-size: 1.15rem;
  vertical-align: middle;
  border: 2px solid #707070 !important;
}

@media (max-width: 1199.98px) {
  .nameplate-card {
    min-width: 760px;
  }
}


.folder-create-header {
  display: flex;
  flex-direction: column;
}

.folder-create-row .form-control,
.folder-create-row .form-select {
  min-height: 50px;
}

.folder-create-row .btn {
  min-height: 50px;
}

@media (min-width: 768px) {
  .folder-create-row .form-text {
    min-height: 2.5em;
  }
}


.public-qr-mini {
  flex: 0 0 auto;
}

.public-qr-mini-img {
  width: 88px;
  height: 88px;
  object-fit: contain;
  border: 1px solid var(--app-border);
  border-radius: .8rem;
  padding: .3rem;
  background: white;
}

.public-link-copy {
  max-width: 560px;
}

.folder-create-row .form-text {
  min-height: 2.8em;
  display: block;
}

.folder-create-row .col-md-2,
.folder-create-row .col-lg-2 {
  display: flex;
  align-items: flex-end;
}


.public-link-copy-inline {
  display: flex;
  align-items: stretch;
  gap: .65rem;
  flex-wrap: nowrap;
}

.public-link-copy-inline .form-control {
  flex: 1 1 auto;
  min-width: 0;
}

.public-link-copy-inline .btn {
  min-width: 130px;
}

.public-qr-mini-img {
  width: 132px;
  height: 132px;
  object-fit: contain;
  border: 1px solid var(--app-border);
  border-radius: .9rem;
  padding: .4rem;
  background: white;
}

.folder-create-row .col-lg-5,
.folder-create-row .col-md-6,
.folder-create-row .col-lg-2,
.folder-create-row .col-md-12 {
  display: flex;
}

.folder-create-field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.folder-create-field .form-control,
.folder-create-field .form-select,
.folder-create-field .btn {
  min-height: 50px;
}

.folder-help-text {
  min-height: 3.2em;
  line-height: 1.35;
  display: block;
}

.folder-create-action {
  justify-content: flex-end;
}

.folder-action-spacer {
  min-height: 24px;
}

@media (max-width: 767.98px) {
  .public-link-copy-inline {
    flex-wrap: wrap;
  }

  .public-link-copy-inline .btn {
    width: 100%;
  }

  .folder-create-row .col-lg-5,
  .folder-create-row .col-md-6,
  .folder-create-row .col-lg-2,
  .folder-create-row .col-md-12 {
    display: block;
  }

  .folder-help-text,
  .folder-action-spacer {
    min-height: 0;
  }
}


.folder-create-row {
  --folder-help-height: 3.1em;
}

.folder-create-row > div {
  display: flex;
  flex-direction: column;
}

.folder-create-row .form-label {
  margin-bottom: .45rem;
}

.folder-create-row .form-control,
.folder-create-row .form-select,
.folder-create-row .folder-create-btn {
  min-height: 50px;
}

.folder-create-row .folder-help-text {
  min-height: var(--folder-help-height);
  display: block;
  line-height: 1.35;
}

.folder-button-col {
  justify-content: flex-start;
}

.folder-button-col .form-label.invisible,
.folder-button-col .form-text.invisible {
  visibility: hidden !important;
}

@media (max-width: 767.98px) {
  .folder-create-row .folder-help-text {
    min-height: 0;
  }
}


.folder-grid-fix {
  --folder-label-height: 24px;
  --folder-input-height: 50px;
  --folder-help-height: 42px;
}

.folder-grid-fix > [class*="col-"] {
  display: flex;
  flex-direction: column;
}

.folder-grid-fix .folder-slot {
  width: 100%;
}

.folder-grid-fix .folder-slot-label {
  min-height: var(--folder-label-height);
  display: flex;
  align-items: flex-end;
  margin-bottom: .45rem;
}

.folder-grid-fix .folder-slot-input {
  min-height: var(--folder-input-height);
  display: flex;
  align-items: stretch;
}

.folder-grid-fix .folder-slot-help {
  min-height: var(--folder-help-height);
  padding-top: .4rem;
}

.folder-grid-fix .form-control,
.folder-grid-fix .form-select,
.folder-grid-fix .folder-create-btn {
  min-height: var(--folder-input-height);
}

.folder-grid-fix .folder-create-btn {
  align-self: stretch;
}

.folder-grid-fix .folder-slot-ghost {
  visibility: hidden;
}

.folder-grid-fix .form-text {
  line-height: 1.25;
}

@media (max-width: 767.98px) {
  .folder-grid-fix .folder-slot-label,
  .folder-grid-fix .folder-slot-help {
    min-height: 0;
  }
  .folder-grid-fix .folder-slot-label {
    margin-bottom: .45rem;
  }
  .folder-grid-fix .folder-slot-help {
    padding-top: .35rem;
  }
  .folder-grid-fix .folder-slot-ghost {
    display: none;
  }
}


.folder-create-stack .folder-password-row {
  margin-top: .15rem;
}

.folder-password-row .form-control {
  min-height: 50px;
}

.folder-password-row .form-text {
  min-height: 2.8em;
}

.folder-password-edit-form .form-control {
  min-height: 48px;
}

.folder-password-edit-form .form-text {
  min-height: 2.6em;
}

.folder-password-edit-action {
  display: flex;
  justify-content: flex-start;
}

.unlock-space-form .form-control,
.unlock-space-form .unlock-space-btn {
  min-height: 50px;
}

.unlock-space-form .col-md-4,
.unlock-space-form .col-md-8 {
  display: flex;
  flex-direction: column;
}

.unlock-space-form .col-md-4 {
  justify-content: flex-end;
}

@media (max-width: 767.98px) {
  .folder-password-edit-action .btn,
  .unlock-space-form .unlock-space-btn {
    width: 100%;
  }
}


.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  vertical-align: middle;
}

.status-dot-green {
  background: #22c55e;
}

.status-dot-red {
  background: #ef4444;
}


.task-check {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.2rem;
  border: 0;
}

.task-check-open {
  background: #dcfce7;
  color: #166534;
}

.task-check-complete {
  background: #22c55e;
  color: white;
}

.task-check-link {
  text-decoration: none;
}

.task-question-link {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: 700;
  font-size: 1.2rem;
}


/* Proper dropdown arrows */
.form-select,
select.form-select,
select.form-control {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 2.5rem;
  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='%236c757d' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.8' d='M3.5 6l4.5 4 4.5-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 14px 14px;
}

select::-ms-expand {
  display: none;
}


/* Form action sizing beside selects/inputs */
.row.g-3.align-items-end .btn,
.row.g-2.align-items-end .btn,
.d-flex.gap-2 .btn,
.link-copy .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}

form .form-select + .btn,
form .form-control + .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.card .d-flex.gap-2 .form-control,
.card .d-flex.gap-2 .form-select,
.card .d-flex.gap-2 .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}

/* Dashboard management selector row */
#space + .btn,
#group + .btn,
#sort + .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}


/* Consistent control heights */
.form-control,
.form-select,
.btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}

.row.g-3.align-items-end .btn,
.row.g-2.align-items-end .btn,
.link-copy .btn,
.d-flex.gap-2 .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Dashboard filter controls */
.dashboard-filter-row .form-control,
.dashboard-filter-row .form-select,
.dashboard-filter-row .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}

/* Toolbox Talk compact top actions */
.toolbox-top-actions form,
.toolbox-top-actions a {
  margin-bottom: 0;
}
.toolbox-top-actions .form-control,
.toolbox-top-actions .btn {
  min-height: calc(1.5em + 0.75rem + 2px);
}


/* Precise filter/action control heights */
.dashboard-filter-row .form-control,
.dashboard-filter-row .form-select {
  height: 38px;
  min-height: 38px;
}

.dashboard-filter-actions .btn {
  height: 38px;
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

/* Generic inline action rows beside fields */
.row.align-items-end .btn,
.d-flex.align-items-center .btn,
.d-flex.gap-2 .btn {
  white-space: nowrap;
}

/* Toolbox Talk top controls */
.toolbox-top-actions {
  align-items: center;
}

.toolbox-top-actions .toolbox-date-input {
  width: 160px;
  height: 31px;
  min-height: 31px;
}

.toolbox-top-actions .btn.btn-sm {
  height: 31px;
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  padding-top: 0;
  padding-bottom: 0;
}

.toolbox-top-actions a.btn {
  flex: 0 0 auto;
}


.form-select,
select.form-select,
select.form-control {
  line-height: 1.5;
  padding-top: .7rem;
  padding-bottom: .7rem;
  background-position: right 0.85rem center;
}

.public-link-copy-inline,
.public-link-copy {
  display: flex;
  align-items: center;
}


/* Authoritative select rendering fix for dashboard Group / Sort and site-wide dropdowns */
.form-select,
select.form-select,
select.form-control {
  min-height: 48px;
  height: 48px;
  line-height: 1.2 !important;
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
  background-position: right 0.85rem center !important;
  vertical-align: middle;
}

/* Firefox / Chromium dropdown text alignment */
@supports (-moz-appearance: none) {
  .form-select,
  select.form-select,
  select.form-control {
    padding-top: 0.65rem !important;
    padding-bottom: 0.65rem !important;
  }
}

/* Match checkbox colour to app theme instead of browser orange */
.form-check-input {
  accent-color: var(--app-primary) !important;
}

.form-check-input:checked {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
}

.form-check-input:focus {
  border-color: var(--app-primary) !important;
  box-shadow: 0 0 0 0.2rem rgba(75,126,166,.15) !important;
}


/* Force site-themed checkboxes everywhere, including application checkboxes */
input[type="checkbox"].form-check-input {
  -webkit-appearance: none;
  appearance: none;
  width: 1.1em;
  height: 1.1em;
  margin-top: 0.2em;
  border: 1px solid var(--app-primary);
  border-radius: 0.25em;
  background-color: #fff;
  display: inline-grid;
  place-content: center;
  cursor: pointer;
}

input[type="checkbox"].form-check-input::before {
  content: "";
  width: 0.6em;
  height: 0.6em;
  transform: scale(0);
  transition: transform 120ms ease-in-out;
  box-shadow: inset 1em 1em #fff;
  clip-path: polygon(14% 44%, 0 58%, 50% 100%, 100% 16%, 84% 0, 43% 62%);
}

input[type="checkbox"].form-check-input:checked {
  background-color: var(--app-primary) !important;
  border-color: var(--app-primary) !important;
}

input[type="checkbox"].form-check-input:checked::before {
  transform: scale(1);
}

input[type="checkbox"].form-check-input:focus {
  outline: none;
  box-shadow: 0 0 0 0.2rem rgba(75,126,166,.15) !important;
}

/* Better dropdown vertical centering across browsers */
.dashboard-filter-row .form-select,
.form-select,
select.form-select,
select.form-control {
  text-align-last: left;
  padding-top: 0.7rem !important;
  padding-bottom: 0.7rem !important;
  line-height: 1.2 !important;
  background-position: right 0.85rem center !important;
}


/* Manage QRVault application toggles */
.app-toggle-row {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.app-toggle-row .app-toggle-input {
  float: none !important;
  position: static !important;
  margin: 0 !important;
  margin-left: 0 !important;
  flex: 0 0 auto;
}

.app-toggle-row .form-check-label {
  margin: 0;
}
