/**
 * CidadãoJá — Balcão Virtual (citizen portal)
 * Palette: eEver blue #1F4E9E · orange #F26522
 */
:root {
  --eever-blue: #1F4E9E;
  --eever-blue-mid: #2d5fb5;
  --eever-blue-light: #e8eef8;
  --eever-blue-dark: #0B1F3A;
  --eever-orange: #F26522;
  --eever-orange-hover: #d95a1e;
  --eever-orange-soft: #fff4ee;
  --eever-border: #e2e8f0;
  --eever-border-light: #f1f5f9;
  --eever-bg-page: #f0f4fa;
  --eever-bg-subtle: #f8fafc;
  --eever-text: #0f172a;
  --eever-text-secondary: #475569;
  --eever-radius-sm: 8px;
  --eever-radius-md: 12px;
  --eever-radius-lg: 16px;
  --eever-radius-xl: 20px;
  --eever-shadow-lg: 0 12px 40px rgba(11, 31, 58, 0.14);
  --eever-shadow-card: 0 2px 8px rgba(11, 31, 58, 0.06), 0 8px 24px rgba(11, 31, 58, 0.08);
  --eever-gradient-hero: linear-gradient(145deg, #0B1F3A 0%, #1a4080 45%, #1F4E9E 100%);
  --eever-focus-ring: 0 0 0 3px rgba(31, 78, 158, 0.35);
  --eever-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* —— Page shell —— */
body.customers {
  background: var(--eever-bg-page) !important;
  color: var(--eever-text);
  -webkit-font-smoothing: antialiased;
}

body.customers #wrapper {
  background: transparent !important;
}

body.customers #content > .container {
  max-width: 1120px;
  padding-bottom: 48px;
}

/* —— Login / Register —— */
body.customers.customers_login,
body.customers.register {
  background: var(--eever-gradient-hero) !important;
  min-height: 100vh;
}

body.customers.customers_login #wrapper,
body.customers.register #wrapper {
  background: transparent !important;
}

body.customers.customers_login::before,
body.customers.register::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 78% 22%, rgba(242, 101, 34, 0.14) 0%, transparent 48%),
    radial-gradient(circle at 12% 88%, rgba(255, 255, 255, 0.06) 0%, transparent 42%);
  pointer-events: none;
  z-index: 0;
}

body.customers.customers_login .navbar,
body.customers.register .navbar,
body.customers.customers_login #header,
body.customers.register #header {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  position: relative;
  z-index: 2;
}

body.customers.customers_login .navbar-nav > li > a,
body.customers.register .navbar-nav > li > a {
  color: rgba(255, 255, 255, 0.92) !important;
}

body.customers.customers_login .navbar-nav > li.active > a,
body.customers.customers_login .navbar-nav > li > a:hover,
body.customers.customers_login .navbar-nav > li > a:focus,
body.customers.register .navbar-nav > li.active > a,
body.customers.register .navbar-nav > li > a:hover,
body.customers.register .navbar-nav > li > a:focus {
  background: rgba(255, 255, 255, 0.14) !important;
  color: #fff !important;
  box-shadow: none !important;
}

body.customers.customers_login .customers-nav-item-login > a,
body.customers.register .customers-nav-item-login > a {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--eever-blue) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12) !important;
}

body.customers.customers_login .customers-nav-item-login.active > a,
body.customers.customers_login .customers-nav-item-login > a:hover,
body.customers.register .customers-nav-item-login.active > a,
body.customers.register .customers-nav-item-login > a:hover {
  background: #fff !important;
  color: var(--eever-blue-dark) !important;
}

body.customers.customers_login .cidadaoja-nav-crest-label,
body.customers.register .cidadaoja-nav-crest-label {
  color: #fff !important;
}

body.customers.customers_login .navbar-toggle .icon-bar,
body.customers.register .navbar-toggle .icon-bar {
  background-color: #fff !important;
}

body.customers.customers_login .login-heading,
body.customers.register h1,
body.customers.register .register-heading {
  color: #fff !important;
  font-weight: 800 !important;
  letter-spacing: -0.03em;
  font-size: clamp(1.35rem, 3vw, 1.65rem) !important;
}

body.customers.register h4.bold {
  color: var(--eever-blue-dark) !important;
  font-weight: 700 !important;
  font-size: 0.95rem !important;
  letter-spacing: -0.01em;
}

body.customers.customers_login .panel_s,
body.customers.register .panel_s {
  border-radius: var(--eever-radius-xl) !important;
  box-shadow: var(--eever-shadow-lg) !important;
  border: 1px solid rgba(255, 255, 255, 0.22) !important;
  overflow: hidden;
}

body.customers.register .panel-body {
  padding: 28px 32px !important;
}

body.customers.customers_login .mtop40,
body.customers.register .mtop40 {
  position: relative;
  z-index: 1;
  padding-top: 20px;
}

body.customers.customers_login .form-control,
body.customers.register .form-control {
  border-radius: var(--eever-radius-sm) !important;
  border-color: var(--eever-border) !important;
  min-height: 44px;
  transition: border-color var(--eever-ease), box-shadow var(--eever-ease);
}

body.customers.customers_login .form-control:focus,
body.customers.register .form-control:focus {
  border-color: var(--eever-blue) !important;
  box-shadow: var(--eever-focus-ring) !important;
}

body.customers.customers_login .btn-primary,
body.customers.register .btn-primary {
  min-height: 46px;
  font-weight: 700 !important;
  letter-spacing: 0.02em;
  border-radius: var(--eever-radius-sm) !important;
  box-shadow: 0 4px 14px rgba(242, 101, 34, 0.32) !important;
}

/* —— Navbar (authenticated) —— */
body.customers:not(.customers_login):not(.register) .navbar,
body.customers:not(.customers_login):not(.register) #header {
  background: rgba(255, 255, 255, 0.97) !important;
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--eever-border) !important;
  box-shadow: 0 2px 16px rgba(11, 31, 58, 0.04) !important;
}

body.customers .navbar-nav > li > a {
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  border-radius: var(--eever-radius-sm);
  margin: 4px 2px;
  padding: 10px 14px !important;
  color: var(--eever-text-secondary) !important;
  transition: background var(--eever-ease), color var(--eever-ease);
}

body.customers .navbar-nav > li.active > a,
body.customers .navbar-nav > li > a:hover,
body.customers .navbar-nav > li > a:focus {
  background: var(--eever-blue-light) !important;
  color: var(--eever-blue) !important;
  outline: none;
}

body.customers .navbar-nav > li.active > a {
  box-shadow: inset 0 -2px 0 var(--eever-orange);
}

body.customers .navbar-brand img,
body.customers .logo img {
  max-height: 48px !important;
  width: auto;
}

/* —— Balcão hero —— */
.cidadaoja-balcao-hero {
  margin: 0 0 28px;
  border-radius: var(--eever-radius-xl);
  overflow: hidden;
  background: var(--eever-gradient-hero);
  color: #fff;
  box-shadow: var(--eever-shadow-lg);
  position: relative;
}

.cidadaoja-balcao-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 92% 8%, rgba(242, 101, 34, 0.22) 0%, transparent 45%),
    radial-gradient(circle at 0% 100%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
  pointer-events: none;
}

.cidadaoja-balcao-hero-inner {
  position: relative;
  padding: 32px 32px 28px;
}

.cidadaoja-balcao-intro {
  margin-bottom: 24px;
  max-width: 580px;
}

.cidadaoja-balcao-hero h2 {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.cidadaoja-balcao-hero .lead {
  margin: 0;
  opacity: 0.92;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.cidadaoja-balcao-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.cidadaoja-balcao-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 16px;
  border-radius: var(--eever-radius-md);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #fff !important;
  text-decoration: none !important;
  transition: background var(--eever-ease), transform var(--eever-ease), border-color var(--eever-ease);
  min-height: 108px;
}

.cidadaoja-balcao-card:hover {
  background: rgba(255, 255, 255, 0.16);
  transform: translateY(-3px);
  border-color: rgba(255, 255, 255, 0.28);
  color: #fff !important;
}

.cidadaoja-balcao-card:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.cidadaoja-balcao-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cidadaoja-balcao-card-icon svg {
  width: 20px;
  height: 20px;
}

.cidadaoja-balcao-card strong {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.35;
}

.cidadaoja-balcao-card span {
  font-size: 0.75rem;
  opacity: 0.85;
  line-height: 1.45;
}

.cidadaoja-balcao-card--highlight {
  background: rgba(242, 101, 34, 0.22);
  border-color: rgba(242, 101, 34, 0.45);
}

.cidadaoja-balcao-card--highlight:hover {
  background: rgba(242, 101, 34, 0.32);
}

/* —— Panels & content —— */
body.customers .panel_s {
  border-radius: var(--eever-radius-lg) !important;
  border: 1px solid var(--eever-border-light) !important;
  box-shadow: var(--eever-shadow-card) !important;
  background: #fff !important;
}

body.customers .panel_s .panel-body {
  padding: 24px !important;
}

body.customers .customer-top-submenu {
  background: #fff;
  border-radius: var(--eever-radius-md);
  padding: 10px 14px !important;
  margin-bottom: 20px;
  border: 1px solid var(--eever-border-light);
  box-shadow: var(--eever-shadow-sm);
}

body.customers .table {
  border-radius: var(--eever-radius-md);
  overflow: hidden;
}

body.customers .table thead th {
  background: var(--eever-bg-subtle) !important;
  color: var(--eever-blue-dark) !important;
  font-weight: 600 !important;
  font-size: 0.8125rem !important;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--eever-border) !important;
}

body.customers .label-primary,
body.customers .badge-primary {
  background: var(--eever-blue) !important;
  border-radius: 6px;
}

body.customers .label-warning,
body.customers .badge-warning,
body.customers .label-info {
  background: var(--eever-orange) !important;
}

body.customers a:not(.btn) {
  color: var(--eever-blue);
  font-weight: 500;
}

body.customers a:not(.btn):hover {
  color: var(--eever-orange);
}

body.customers .btn-primary {
  background: var(--eever-orange) !important;
  border-color: var(--eever-orange) !important;
  font-weight: 700;
  border-radius: var(--eever-radius-sm) !important;
  box-shadow: 0 2px 8px rgba(242, 101, 34, 0.25);
}

body.customers .btn-primary:hover {
  background: var(--eever-orange-hover) !important;
  border-color: var(--eever-orange-hover) !important;
}

body.customers .btn-default {
  border: 2px solid var(--eever-blue) !important;
  color: var(--eever-blue) !important;
  font-weight: 600;
  border-radius: var(--eever-radius-sm) !important;
}

/* —— Tickets empty state —— */
body.customers .dataTables_empty {
  color: var(--eever-text-muted) !important;
  padding: 32px !important;
}

.cidadaoja-balcao-grid--wide {
  grid-template-columns: repeat(3, 1fr);
}

/* —— Navbar crest (portal) —— */
.cidadaoja-nav-crest-wrap {
  display: inline-flex !important;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  max-width: min(320px, 55vw);
  margin-right: 8px;
  padding: 4px 0;
}

.cidadaoja-nav-crest {
  height: 48px;
  width: auto;
  flex-shrink: 0;
}

.cidadaoja-nav-crest-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--eever-blue-dark);
  line-height: 1.25;
  letter-spacing: -0.02em;
}

body.customers.customers_login .cidadaoja-nav-crest-wrap,
body.customers.register .cidadaoja-nav-crest-wrap {
  display: inline-flex !important;
  max-width: min(280px, 70vw);
}

body.customers.customers_login .cidadaoja-nav-crest,
body.customers.register .cidadaoja-nav-crest {
  height: 44px;
}

@media (max-width: 992px) {
  .cidadaoja-balcao-grid--wide {
    grid-template-columns: repeat(2, 1fr);
  }

  .cidadaoja-nav-crest-label {
    display: none;
  }
}

@media (max-width: 576px) {
  .cidadaoja-balcao-grid,
  .cidadaoja-balcao-grid--wide {
    grid-template-columns: 1fr;
  }

  .cidadaoja-balcao-hero-inner {
    padding: 22px 18px 20px;
  }

  body.customers.register .panel-body {
    padding: 20px 18px !important;
  }

  /* Login / registo Balcão — telemóvel */
  body.customers.customers_login #content > .container,
  body.customers.register #content > .container {
    padding-left: 12px !important;
    padding-right: 12px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.customers.customers_login .login-heading,
  body.customers.register h1,
  body.customers.register .register-heading {
    font-size: 1.15rem !important;
    line-height: 1.25 !important;
    padding: 0 8px;
  }

  body.customers.customers_login .mtop40,
  body.customers.register .mtop40 {
    padding-top: 8px;
  }

  body.customers.customers_login .mtop40 > [class*="col-"],
  body.customers.register .mtop40 > [class*="col-"],
  body.customers.customers_login .row > [class*="col-"],
  body.customers.register .row > [class*="col-"] {
    width: 100% !important;
    float: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
  }

  body.customers.customers_login .panel_s .panel-body,
  body.customers.register .panel_s .panel-body {
    padding: 20px 16px !important;
  }

  body.customers.customers_login .form-control,
  body.customers.register .form-control {
    font-size: 16px !important;
  }

  body.customers.customers_login .navbar a.navbar-brand,
  body.customers.register .navbar a.navbar-brand {
    max-width: calc(100% - 56px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cidadaoja-balcao-card {
    transition: none;
  }
}

/* —— Recuperar palavra-passe (mesmo visual do login) —— */
body.customers .forgot-password-heading h1,
body.customers .authentication-forgot-password h1 {
  color: #fff !important;
  font-weight: 800 !important;
}

body.customers:has(.forgot-password-heading) {
  background: var(--eever-gradient-hero) !important;
  min-height: 100vh;
}

body.customers:has(.forgot-password-heading) .navbar-nav > li > a {
  color: rgba(255, 255, 255, 0.92) !important;
}

body.customers:has(.forgot-password-heading) .panel_s {
  border-radius: var(--eever-radius-xl) !important;
  box-shadow: var(--eever-shadow-lg) !important;
}

/* —— Dashboard: esconder widgets CRM fora do âmbito Junta —— */
body.customers .projects-summary-heading,
body.customers .projects-summary,
body.customers .invoices-quick-info-heading,
body.customers #client-home-chart,
body.customers .section-client-dashboard > .panel_s:has(#client-home-chart) {
  display: none !important;
}

/* —— Inquéritos (Surveys) —— */
body.customers .survey,
body.customers .survey-form,
.survey-form-wrap,
#survey_form {
  font-family: Inter, system-ui, sans-serif;
}

body.customers .survey .logo,
.survey-form-wrap .logo {
  background: var(--eever-blue-dark) !important;
  border-radius: var(--eever-radius-md) var(--eever-radius-md) 0 0;
}

body.customers .survey .panel-body,
.survey-form-wrap .panel_s,
.survey-form-wrap .panel-body {
  border-radius: var(--eever-radius-lg) !important;
  border: 1px solid var(--eever-border) !important;
  box-shadow: var(--eever-shadow-card) !important;
}

body.customers .survey #submit,
.survey-form-wrap .btn-success,
.survey-form-wrap #submit {
  background: var(--eever-orange) !important;
  border-color: var(--eever-orange) !important;
  border-radius: var(--eever-radius-sm) !important;
  font-weight: 700 !important;
  min-height: 44px;
  padding: 10px 22px;
}

body.customers .survey #submit:hover,
.survey-form-wrap .btn-success:hover {
  background: var(--eever-orange-hover) !important;
  border-color: var(--eever-orange-hover) !important;
}

/* —— Appointly formulário público —— */
body.appointments-external-form {
  background: var(--eever-bg-page) !important;
  font-family: Inter, system-ui, sans-serif;
  color: var(--eever-text);
}

body.appointments-external-form #wrapper {
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

body.appointments-external-form .appointments-external-form-heading,
body.appointments-external-form h2,
body.appointments-external-form h3 {
  color: var(--eever-blue-dark) !important;
  font-weight: 800 !important;
  letter-spacing: -0.02em;
}

body.appointments-external-form .panel,
body.appointments-external-form .panel_s,
body.appointments-external-form .appointments-form-wrapper {
  border-radius: var(--eever-radius-xl) !important;
  border: 1px solid var(--eever-border) !important;
  box-shadow: var(--eever-shadow-card) !important;
  overflow: hidden;
}

body.appointments-external-form .form-control {
  border-radius: var(--eever-radius-sm) !important;
  min-height: 44px;
  border-color: var(--eever-border) !important;
}

body.appointments-external-form .form-control:focus {
  border-color: var(--eever-blue) !important;
  box-shadow: var(--eever-focus-ring) !important;
}

body.appointments-external-form .btn-primary,
body.appointments-external-form button[type="submit"],
body.appointments-external-form .btn-info {
  background: var(--eever-orange) !important;
  border-color: var(--eever-orange) !important;
  border-radius: var(--eever-radius-sm) !important;
  font-weight: 700 !important;
  min-height: 44px;
}

body.appointments-external-form .btn-primary:hover,
body.appointments-external-form button[type="submit"]:hover {
  background: var(--eever-orange-hover) !important;
  border-color: var(--eever-orange-hover) !important;
}

body.appointments-external-form .available-time,
body.appointments-external-form .appointment-available-hours {
  color: var(--eever-blue) !important;
}

body.appointments-external-form .busy-time,
body.appointments-external-form .appointment-busy-hours {
  color: #b91c1c !important;
}

/* —— Base de conhecimento / pedidos —— */
body.customers .kb-search-jumbotron,
body.customers .kb-article {
  border-radius: var(--eever-radius-lg) !important;
}

body.customers .table-tickets td,
body.customers .table-tickets th {
  font-size: 0.9rem;
}

body.customers .label,
body.customers .badge {
  border-radius: 999px;
  font-weight: 600;
}
