/* Chatterfy Auth Screen, RU/EN Switcher, Profile & Admin Company Pages */

.auth-screen {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 20px;
  background: radial-gradient(80% 100% at 50% 0, #006fee33, #006fee00), #000;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 28px 24px 24px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #161d2c;
  box-shadow: 0 24px 90px #000a;
  display: grid;
  gap: 18px;
}

.auth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: #fff;
}

.auth-brand img {
  width: 30px;
  height: 30px;
}

.auth-head h1 {
  font-size: 20px;
  font-weight: 650;
  line-height: 28px;
  margin-bottom: 4px;
}

.auth-head p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form .field {
  min-height: 38px;
  font-size: 14px;
  border-radius: 10px;
}

.auth-submit {
  min-height: 38px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 4px;
}

.auth-error {
  padding: 9px 12px;
  border-radius: 8px;
  background: rgba(243, 18, 96, 0.14);
  border: 1px solid rgba(243, 18, 96, 0.35);
  color: #ff7a9e;
  font-size: 13px;
  line-height: 1.4;
}

/* Segmented RU / EN switcher */
.lang-switch {
  display: inline-flex;
  align-items: center;
  padding: 2px;
  border-radius: 8px;
  background: #0f1b2b;
  border: 1px solid var(--border);
  gap: 2px;
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}

.lang-switch button[aria-pressed="true"] {
  background: var(--primary);
  color: #fff;
}

.rail-lang-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 26px;
  border-radius: 7px;
  border: 1px solid var(--border);
  background: #0f1b2b;
  color: #cdd8ea;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.rail-lang-btn:hover {
  background: #1a2337;
  color: #fff;
}

/* Profile modal */
.profile-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.profile-user {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.profile-user-meta {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.profile-user-meta strong {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-user-meta span {
  font-size: 12px;
  color: var(--muted);
}

.profile-section {
  display: grid;
  gap: 10px;
  padding-top: 14px;
}

.profile-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.profile-pw-form {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-radius: 10px;
  background: #0f1b2b;
  border: 1px solid var(--line);
}

/* Badges & Admin Company UI */
.role-badge,
.active-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.role-badge.admin {
  background: rgba(3, 132, 246, 0.16);
  color: #6cb8ff;
}

.role-badge.operator {
  background: rgba(255, 255, 255, 0.08);
  color: #d4d4d8;
}

.active-badge.on {
  background: rgba(23, 201, 100, 0.14);
  color: #17c964;
}

.active-badge.off {
  background: rgba(243, 18, 96, 0.14);
  color: #f31260;
}

.admin-card {
  max-width: 680px;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #101726;
  display: grid;
  gap: 16px;
}

.admin-form {
  display: grid;
  gap: 14px;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.admin-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
}

.admin-checkbox input {
  accent-color: var(--primary);
  width: 15px;
  height: 15px;
}

.user-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.pa-table code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  color: #a1ceff;
}

/* Custom modal overlay (works seamlessly with HeroUI dropdown.js at z-index 250) */
.cfy-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(4px);
  display: grid;
  place-items: center;
  padding: 16px;
}

.cfy-modal {
  width: min(500px, 100%);
  max-height: min(88dvh, 780px);
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #161d2c;
  box-shadow: 0 24px 90px #000a;
  color: var(--text);
  overflow: hidden;
}

.cfy-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 16px 18px 10px 20px;
}

.cfy-modal-head h2 {
  font-size: 18px;
  font-weight: 600;
}

.cfy-modal-body {
  padding: 10px 20px 18px;
  overflow-y: auto;
  display: grid;
  gap: 14px;
}

.cfy-modal-foot {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--line);
}

@media (max-width: 768px) {
  .auth-card {
    padding: 22px 18px 20px;
  }

  .admin-form-grid {
    grid-template-columns: 1fr;
  }

  .admin-card {
    padding: 16px;
  }

  .cfy-modal-backdrop {
    padding: 8px;
  }
}
