/* Sign-in and account pages: the app's look (popup.css) in a page layout. */

.auth {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
}

.auth-hero {
  position: relative;
  overflow: hidden;
  padding: 14px 16px 76px;
  background: var(--hero);
  color: #fff;
}

.auth-hero-small {
  padding-bottom: 66px;
}

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

.auth-brand {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 4px;
  margin-top: 12px;
  text-align: center;
}

.auth-brand-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  text-align: left;
}

.auth-mark {
  width: 64px;
  height: 64px;
  margin-bottom: 4px;
  border-radius: 18px;
  box-shadow: 0 10px 24px -10px rgb(0 0 0 / 0.55), 0 0 0 1px rgb(255 255 255 / 0.25);
}

.auth .brand-title {
  font-size: 24px;
}

.avatar {
  display: grid;
  flex: none;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgb(255 255 255 / 0.28);
  border-radius: 50%;
  background: rgb(255 255 255 / 0.14);
  font-size: 24px;
}

.avatar.is-brand {
  width: auto;
  height: auto;
  padding: 4px 8px;
  border: 0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 2px 6px rgb(0 0 0 / 0.25);
}

.avatar.is-brand img {
  display: block;
  height: 44px;
}

.company-name {
  margin: 0;
  font: 800 20px/1.25 var(--font);
}

.account-email {
  margin: 3px 0 0;
  overflow: hidden;
  font-size: 13px;
  opacity: 0.85;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 40px;
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  text-decoration: underline;
}

.auth-main {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 14px;
  margin-top: -50px;
  padding: 0 14px 16px;
}

.auth-card {
  display: grid;
  gap: 13px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow-float);
}

.auth-title {
  margin: 0;
  font: 800 21px/1.2 var(--font);
}

.auth-title-sm {
  font-size: 16px;
}

.auth-text {
  margin: 3px 0 0;
  color: var(--muted);
}

.auth .field-box {
  min-height: 46px;
}

.auth .field-box input[type] {
  flex: 1;
  width: 100%;
  font-size: 16px; /* also stops iOS from zooming in */
  font-weight: 600;
}

/* Show / hide password */
.eye-btn {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  margin: -6px -6px -6px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--muted);
  font-size: 18px;
  cursor: pointer;
}

.eye-btn:hover {
  color: var(--accent);
}

.eye-btn .eye-hide,
.eye-btn[aria-pressed="true"] .eye-show {
  display: none;
}

.eye-btn[aria-pressed="true"] .eye-hide {
  display: block;
}

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

.check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  font-weight: 600;
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--brand);
}

.auth-link {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover {
  text-decoration: underline;
}

/* Messages under a form: errors in red, notes in the tint. */
.auth-message {
  margin: 0;
  padding: 9px 12px;
  border-left: 3px solid var(--tint-ink);
  border-radius: 10px;
  background: var(--tint);
  font-weight: 600;
}

.auth-message.is-error {
  border-left-color: var(--danger);
  background: var(--danger-bg);
  color: var(--danger);
}

/* The account page stays empty until it knows who is signed in. */
.is-loading .auth-main {
  visibility: hidden;
}

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

.auth .segmented span {
  padding: 10px 8px;
}

.sign-out {
  align-self: center;
  min-height: 40px;
  font-size: 14px;
}

.auth .app-footer {
  margin-top: auto;
  padding-top: 10px;
}

@media (max-width: 360px) {
  .two {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The app hides its subtitle on phones (no room beside the buttons); here there is room. */
.auth .auth-brand .brand-sub {
  display: block;
}

/* The account header has text where the flight trail would run. */
.auth-hero-small .hero-trail {
  display: none;
}

/* The admin account's way to the admin page (account.html) */
.admin-link {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  text-decoration: none;
}

.admin-link > .icon:first-child {
  flex: none;
  color: var(--tint-ink);
  font-size: 24px;
}

.admin-link > span {
  display: grid;
  gap: 2px;
}

.admin-link .auth-text {
  margin: 0;
  font-size: 13px;
}

.admin-link-go {
  flex: none;
  margin-left: auto;
  color: var(--muted);
}

.admin-link:hover {
  outline: 1.5px solid var(--accent);
}

/* Admin page (admin.html) */
.auth-wide {
  max-width: 640px;
}

.auth-title .icon {
  color: var(--tint-ink);
  vertical-align: -3px;
}

.created {
  display: grid;
  justify-items: start;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--tint);
}

.created-text {
  margin: 0;
  font-weight: 600;
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.users-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.users {
  display: grid;
  gap: 8px;
}

.user {
  border: 1.5px solid var(--line-strong);
  border-radius: 14px;
  background: var(--card);
}

.user[open] {
  border-color: var(--accent);
}

.user-summary {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  list-style: none;
  cursor: pointer;
}

.user-summary::-webkit-details-marker {
  display: none;
}

.user-badge {
  display: grid;
  flex: none;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--tint);
  color: var(--tint-ink);
  font-weight: 800;
}

.user-badge.is-brand {
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--line-strong);
}

.user-badge.is-brand img {
  width: 32px;
  height: auto;
}

.user-main {
  display: grid;
  flex: 1;
  gap: 1px;
  min-width: 0;
}

.user-email,
.user-meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-email {
  font-weight: 700;
}

.user-meta,
.user-dates,
.device-meta,
.devices-empty {
  color: var(--muted);
  font-size: 12px;
}

.user-tags {
  display: flex;
  flex: none;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  max-width: 45%;
}

.tag {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--tint);
  color: var(--tint-ink);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}

.tag.is-danger {
  background: var(--danger-bg);
  color: var(--danger);
}

.user-body {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.user-dates {
  margin: 0;
}

.devices {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.device {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: var(--bg);
}

.device-icon {
  flex: none;
  color: var(--tint-ink);
  font-size: 20px;
}

.device-main {
  display: grid;
  flex: 1;
  min-width: 0;
}

.device-name {
  font-weight: 700;
}

.device-meta {
  white-space: pre-line;
}

.device .btn {
  flex: none;
}

.user-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.btn.is-danger {
  color: var(--danger);
}

.btn.is-danger:hover:not(:disabled) {
  border-color: var(--danger);
}

.password-row {
  display: grid;
  gap: 8px;
}

.password-row .field-hint {
  margin: 0;
}

.password-row .btn {
  justify-self: start;
}
