/* Authentication pages */

body.company-lusorede .loginpage {
  background-image:
    linear-gradient(120deg, rgba(12, 24, 36, 0.68), rgba(var(--brand-color-rgb), 0.28)),
    url("/static/img/lusorede-index-bg.jpg");
}

body.company-lusoinstal .loginpage {
  background-image:
    linear-gradient(120deg, rgba(28, 18, 16, 0.68), rgba(var(--brand-color-rgb), 0.28)),
    url("/static/img/lusoinstal-index-bg.jpg");
}

body.company-eie .loginpage {
  background-image:
    linear-gradient(120deg, rgba(22, 28, 14, 0.68), rgba(var(--brand-color-rgb), 0.28)),
    url("/static/img/eie-index-bg.jpg");
}

.loginpage {
  align-items: center;
  background-position: center;
  background-size: cover;
  display: flex;
  min-height: calc(100vh - 116px);
  padding: 46px 18px;
}

.container-loginpage {
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin: 0 auto;
  padding: 0;
  width: 100%;
}

.loginpage .container-login:not(.auth-login-card) {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(8, 21, 34, 0.22);
  margin: 18px auto;
  max-width: 440px;
  padding: 24px;
  text-align: center;
  width: min(100%, 440px);
}

.loginpage .container-login:not(.auth-login-card) img {
  border-radius: 6px;
  height: auto;
  margin: 0 0 22px;
  max-width: 140px;
}

.container-login.auth-login-card {
  align-items: stretch;
  backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  box-shadow: 0 24px 70px rgba(8, 21, 34, 0.28);
  display: grid;
  gap: 0;
  grid-template-columns: minmax(180px, 0.75fr) minmax(260px, 1fr);
  margin: 0 auto;
  max-width: 760px;
  overflow: hidden;
  padding: 0;
  width: min(100%, 760px);
}

.auth-login-brand {
  align-items: center;
  background: linear-gradient(180deg, var(--surface-bg), var(--brand-color-soft));
  border-right: 1px solid var(--brand-color-border);
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: 34px 28px;
  text-align: center;
}

.auth-login-brand img {
  border-radius: 6px;
  height: auto;
  margin: 0 0 28px;
  max-width: 156px;
  object-fit: contain;
  width: 100%;
}

.auth-login-brand .title {
  color: var(--brand-color-dark);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.container-login .box {
  align-content: center;
  display: grid;
  padding: 38px;
}

.auth-login-form {
  display: grid;
  gap: 16px;
}

.auth-login-form .field {
  margin: 0;
}

.auth-login-form .control {
  width: 100%;
}

.auth-login-form .input {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-color);
  font-size: 15px;
  height: 46px;
  line-height: 1.2;
  padding: 0 14px;
  width: 100%;
}

.auth-login-form .input:focus {
  border-color: var(--brand-color);
  box-shadow: 0 0 0 0.22rem var(--focus-ring);
  outline: none;
}

.auth-login-form .checkbox {
  align-items: center;
  color: var(--text-soft);
  display: inline-flex;
  font-size: 14px;
  gap: 8px;
  margin: 2px 0 0;
}

.auth-login-form .checkbox input {
  accent-color: var(--brand-color);
}

.auth-login-form .button,
.container-login.auth-login-card button {
  align-items: center;
  background: var(--brand-color);
  border: 0;
  border-radius: 10px;
  color: #fff;
  display: inline-flex;
  font-size: 15px;
  font-weight: 700;
  height: 46px;
  justify-content: center;
  letter-spacing: 0;
  margin: 0;
  padding: 0 18px;
  text-transform: uppercase;
  width: 100%;
}

.auth-login-form .button:hover,
.container-login.auth-login-card button:hover {
  background: var(--brand-color-dark);
}

.auth-login-form .button:disabled {
  cursor: wait;
  opacity: 0.76;
}

.auth-login-form .button.is-loading::after {
  animation: spin 0.8s linear infinite;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 50%;
  content: "";
  display: inline-block;
  height: 15px;
  margin-left: 10px;
  width: 15px;
}

.container-login.auth-login-card .notification {
  background: #fff0f0;
  border: 1px solid #f1b9b9;
  border-radius: 10px;
  color: #9b1c1c;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 16px;
  padding: 12px 14px;
}

@media (max-width: 768px) {
  .loginpage {
    min-height: calc(100vh - 92px);
    padding: 28px 14px 92px;
  }

  .container-login.auth-login-card {
    border-radius: 12px;
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .auth-login-brand {
    border-bottom: 1px solid var(--brand-color-border);
    border-right: 0;
    min-height: 0;
    padding: 28px 24px 22px;
  }

  .auth-login-brand img {
    margin-bottom: 18px;
    max-width: 136px;
  }

  .auth-login-brand .title {
    font-size: 22px;
  }

  .container-login .box {
    padding: 26px 22px;
  }
}

.profile-page {
  min-height: calc(100vh - 150px);
  padding: 30px 0 56px;
  background: #f4f7fa;
}

.profile-shell {
  overflow: hidden;
  border: 1px solid #dfe7ef;
  border-radius: 8px;
  background: #fff;
}

.profile-header {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 24px 28px;
  border-bottom: 1px solid #dfe7ef;
  background: #f8fafc;
}

.profile-avatar {
  display: grid;
  width: 64px;
  height: 64px;
  place-items: center;
  border-radius: 50%;
  background: var(--brand-color);
  color: #fff;
  font-size: 21px;
  font-weight: 800;
}

.profile-eyebrow,
.profile-overview span,
.profile-company-meta span,
.profile-current-context span {
  display: block;
  color: #64748b;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
}

.profile-identity h1 {
  margin: 3px 0 2px;
  color: #172331;
  font-size: 1.55rem;
  letter-spacing: 0;
}

.profile-identity p,
.profile-current-context,
.profile-section-heading p,
.profile-no-access p {
  margin: 0;
  color: #64748b;
}

.profile-current-context {
  min-width: 140px;
  padding-left: 20px;
  border-left: 1px solid #dfe7ef;
}

.profile-current-context strong {
  color: var(--brand-color-dark);
  font-size: 0.95rem;
}

.profile-loading {
  display: flex;
  min-height: 220px;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #475569;
  font-weight: 700;
}

.profile-spinner {
  width: 34px;
  height: 34px;
  border: 3px solid #d9e4ed;
  border-top-color: var(--brand-color);
  border-radius: 50%;
  animation: profile-spin 0.8s linear infinite;
}

@keyframes profile-spin {
  to { transform: rotate(360deg); }
}

.profile-error {
  margin: 20px 28px;
  padding: 12px 14px;
  border: 1px solid #fecaca;
  border-radius: 6px;
  background: #fef2f2;
  color: #991b1b;
}

.profile-overview,
.profile-company-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.profile-overview {
  border-bottom: 1px solid #dfe7ef;
}

.profile-overview > div,
.profile-company-meta > div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid #e5ebf1;
}

.profile-overview > div:last-child,
.profile-company-meta > div:last-child {
  border-right: 0;
}

.profile-overview > div:nth-child(4n) {
  border-right: 0;
}

.profile-overview strong,
.profile-company-meta strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: #1e293b;
  font-size: 0.9rem;
}

.profile-companies-section {
  padding: 24px 28px 30px;
}

.profile-section-heading {
  margin-bottom: 17px;
}

.profile-section-heading h2 {
  margin: 0 0 3px;
  color: #172331;
  font-size: 1.15rem;
}

.profile-company-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid #cbd5e1;
}

.profile-company-tab {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  padding: 8px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #475569;
  font-weight: 700;
}

.profile-company-tab:hover,
.profile-company-tab.active {
  border-bottom-color: var(--brand-color);
  color: var(--brand-color-dark);
}

.profile-company-tab.unavailable {
  color: #94a3b8;
}

.profile-company-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.profile-company-tab.unavailable .profile-company-status {
  background: #cbd5e1;
}

.profile-company-detail {
  padding-top: 20px;
}

.profile-company-meta {
  margin-bottom: 22px;
  border: 1px solid #dfe7ef;
  border-radius: 6px;
  background: #f8fafc;
}

.profile-permission-section {
  padding: 17px 0;
  border-top: 1px solid #e5ebf1;
}

.profile-permission-section h3 {
  margin: 0 0 11px;
  color: #334155;
  font-size: 0.9rem;
}

.profile-permission-section h3 span {
  display: inline-block;
  min-width: 24px;
  margin-left: 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #e2e8f0;
  text-align: center;
  font-size: 0.7rem;
}

.profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.profile-badges span {
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  background: #f8fafc;
  color: #334155;
  font-size: 0.76rem;
  overflow-wrap: anywhere;
}

.profile-badges.permissions span {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1e40af;
}

.profile-badges.allow span {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.profile-badges.deny span {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.profile-empty-list {
  margin: 0;
  color: #94a3b8;
  font-size: 0.82rem;
}

.profile-direct-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.profile-no-access {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 28px 0;
  color: #64748b;
}

.profile-no-access i {
  margin-top: 2px;
  color: #94a3b8;
  font-size: 20px;
}

.profile-no-access strong {
  display: block;
  margin-bottom: 3px;
  color: #334155;
}

@media (max-width: 800px) {
  .profile-page {
    padding: 16px 10px 44px;
  }

  .profile-header {
    grid-template-columns: 54px minmax(0, 1fr);
    padding: 18px;
  }

  .profile-avatar {
    width: 50px;
    height: 50px;
    font-size: 17px;
  }

  .profile-current-context {
    grid-column: 1 / -1;
    padding: 10px 0 0;
    border-top: 1px solid #dfe7ef;
    border-left: 0;
  }

  .profile-overview,
  .profile-company-meta,
  .profile-direct-grid {
    grid-template-columns: 1fr 1fr;
  }

  .profile-overview > div:nth-child(2),
  .profile-company-meta > div:nth-child(2) {
    border-right: 0;
  }

  .profile-companies-section {
    padding: 20px 18px 24px;
  }
}

@media (max-width: 480px) {
  .profile-overview,
  .profile-company-meta,
  .profile-direct-grid {
    grid-template-columns: 1fr;
  }

  .profile-overview > div,
  .profile-company-meta > div {
    border-right: 0;
    border-bottom: 1px solid #e5ebf1;
  }

  .profile-overview > div:last-child,
  .profile-company-meta > div:last-child {
    border-bottom: 0;
  }
}
