form {
  display: flex;
  height: 100vh;
  flex-direction: column;
  width: 80%;
  justify-content: center;
  align-items: center;
  margin: 0 auto;
  row-gap: 20px;
}

#title {
  position: fixed;
  top: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: all 1s;
  z-index: 4;
}
#title:not(.first) {
  transform: translateY(-70px);
}

input {
  background: linear-gradient(to left, #edfffd, #fdecec);
}

#title > h1 {
  margin: 0;
  padding: 15px;
  font-size: 1.7rem;
  background: linear-gradient(to right, #edfffd, #fdecec);
  border-bottom: 1px solid #ccc;
  width: 100%;
}

#title > button {
  font-size: 1.5rem;
  padding: 0;
  width: 50px;
  line-height: 20px;
  border: none;
  padding-bottom: 10px;
  transition: all 1s;
  border: 1px solid #ccc;
  border-bottom-right-radius: 5px;
  border-bottom-left-radius: 5px;
  z-index: 3;
}

#title.first > button {
  display: none;
}

#title:not(.first):hover {
  transform: translateY(0);
}

#title:not(.first):hover > button {
  transform: translateY(-100px);
}

h1,
h2 {
  text-align: center;
}

h2 {
  margin-bottom: 30px;
}

form input {
  padding: 10px 15px;
  font-size: 1.2rem;
  border-radius: 5px;
  border: 1px dotted black;
  text-align: center;
}

form button {
  padding: 10px 15px;
  font-size: 2rem;
  background: #333;
  border: 1px solid #666;
  color: white;
  outline: 2px solid #aaa;
  border-radius: 20px;
}

.form-actions {
  display: flex;
  align-items: center;
  column-gap: 16px;
}

.form-actions .home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  background: #a1e3ff;
  border: 1px solid #74d0ff;
  outline: 2px solid rgba(116, 208, 255, 0.6);
  border-radius: 20px;
  color: white;
  text-decoration: none;
  transition: background 0.2s ease;
}

.form-actions .home-link:hover {
  background: #8bd9ff;
}

.form-actions .home-link:active {
  background: #6acbff;
}

.form-actions .home-link svg {
  width: 24px;
  height: 24px;
}

form button:hover {
  background: #444;
}

form button:active {
  background: #222;
}

.error {
  color: red;
  height: 2rem;
}

body {
  background: linear-gradient(to right, #edfffd, #fdecec);
}
body,
html {
  padding: 0;
  margin: 0;
  font-family: sans;
}

#main {
  display: flex;
  flex-direction: column;
  width: 100%;
  justify-content: center;
  width: 80%;
  margin: 70px auto;
  font-size: 1.1em;
  row-gap: 30px;
}

#main summary {
  font-size: 1.5rem;
  padding: 10px;
  cursor: pointer;
  background: rgba(0, 159, 255, 0.07);
  border-top-left-radius: 10px;
  border-top-right-radius: 10px;
  border-bottom-left-radius: 10px;
  border-bottom-right-radius: 10px;
}

#main details[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

#main summary:hover {
  background: rgba(0, 159, 255, 0.2);
}

#main summary:active {
  background: rgba(0, 159, 255, 0.4);
}

#main details {
  border: 1px solid rgba(0, 159, 255, 0.2);
  border-radius: 10px;
}

#main details > div {
  padding: 20px;
}

#main #search-div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  justify-content: space-between;
}

@media (max-width: 800px) {
  #main #search-div {
    flex-direction: column-reverse;
  }
}

#main #search-div div {
  display: flex;
  align-items: center;
  column-gap: 12px;
  padding: 8px 12px;
}

#main #search-div .toggle {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  cursor: pointer;
  color: #333;
  user-select: none;
  justify-content: center;
}

#main #search-div .toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

#main #search-div .toggle-track {
  position: relative;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  transition: background 0.2s ease;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.08);
}

#main #search-div .toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease;
}

#main #search-div .toggle input:checked + .toggle-track {
  background: rgba(0, 159, 255, 0.65);
}

#main #search-div .toggle input:checked + .toggle-track .toggle-thumb {
  transform: translateX(20px);
}

#main #search-div .toggle input:focus-visible + .toggle-track {
  outline: 2px solid rgba(0, 159, 255, 0.9);
  outline-offset: 2px;
}

#main #search-div .toggle-copy {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.95rem;
}

#main #search-div .toggle-status {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.08);
  color: #444;
  transition: color 0.2s ease, background 0.2s ease;
}

#main #search-div .toggle input:checked + .toggle-track + .toggle-copy .toggle-status {
  background: rgba(0, 159, 255, 0.18);
  color: rgba(0, 64, 102, 0.95);
}

#main #search-div .toggle-hint {
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(51, 65, 85, 0.7);
  line-height: 1.2;
  text-align: center;
}

#main input#search-box {
  min-width: 220px;
  padding: 10px 15px;
  font-size: 1.2rem;
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-top: 1px solid rgba(0, 0, 0, 0.18);
  border-left: 1px solid rgba(0, 0, 0, 0.18);
  border-right: 1px solid rgba(0, 0, 0, 0.18);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#main input#search-box:hover {
  border-color: rgba(0, 159, 255, 0.45);
}

#main input#search-box:focus {
  border-color: rgba(0, 159, 255, 0.8);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 159, 255, 0.18);
  outline: none;
}

#main input#search-box::placeholder {
  color: rgba(51, 65, 85, 0.6);
}

#main input#search-box.no-results {
  outline: 2px solid red;
  background: rgba(255, 0, 0, 0.3);
}

#main #all-people {
  max-height: 80vh;
  overflow-y: auto;
}

#main .user-result {
  justify-content: space-between;
  align-items: center;
  display: none;
  font-size: 1.1rem;
  padding: 10px;
  gap: 12px;
  min-height: 64px;
}

#main .user-result.show {
  display: flex;
}

#main .user-result:nth-child(odd of .show) {
  background: #fafafa;
}

#main .user-result.show:hover {
  background: rgba(0, 159, 255, 0.2);
}

#main .user-result.show:active {
  background: rgba(0, 159, 255, 0.4);
}

#main .display-name {
  color: gray;
  font-size: 0.8rem;
}

#main .info {
  font-size: 1.3rem;
  margin: 0 auto 20px auto;
  width: fit-content;
  text-align: center;
}

#main .person {
  border: 1px solid rgba(0, 159, 255, 0.4);
  padding: 10px 15px;
}

#main .person:first-child {
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
}

#main .person:last-child {
  border-bottom-left-radius: 5px;
  border-bottom-right-radius: 5px;
}

#main .person.na {
  border: 1px solid #ccc;
  color: #ccc;
}

#main .person {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
}

#main .person:not(.na):not(.same-lock):hover {
  background: rgba(0, 159, 255, 0.2);
}

#main .person .person-core,
#main .user-result .person-core {
  display: flex;
  align-items: center;
  gap: 12px;
}

#main .person .person-core {
  flex: 1;
}

#main .user-result .person-core {
  width: 100%;
}

#main .person .person-text,
#main .user-result .person-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#main .person .actions {
  display: flex;
  flex-direction: row;
  column-gap: 10px;
}

#main button {
  line-height: 2em;
  padding: 5px 15px;
  border: none;
  border-radius: 10px;
  opacity: 0.9;
  font-weight: bold;
  font-size: 1rem;
}

#main .logout {
  color: white;
  background: red;
  margin: 20px 30px;
  width: fit-content;
  align-self: center;
}

#main .person .actions button {
  color: white;
}

#main .person .actions button.accept,
#main .person .actions button.lock {
  background: green;
}
#main .person .actions button.unlock {
  background: #696937;
}
#main .person .actions button.deselect {
  background: red;
}

#main button:hover {
  opacity: 0.6;
}

#main button:active {
  opacity: 1;
}

#main .person .same-lock {
  color: green;
  font-size: 0.9em;
}

#main .person.same-lock {
  background: rgba(0, 255, 0, 0.1);
}

#main .same-lock.person:not(.na):hover {
  background: rgba(0, 255, 0, 0.3);
}

#main .diff-lock {
  color: red;
  font-size: 0.9em;
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #f1f5f9;
  border: 1px solid rgba(15, 23, 42, 0.12);
  flex-shrink: 0;
}

.avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
}

@media (max-width: 600px) {
  .avatar {
    width: 40px;
    height: 40px;
  }
}

@media (max-width: 800px) {
  #main {
    width: 100%;
    font-size: 0.9em;
    margin: 70px auto 0 auto;
  }
  #main details {
    border-radius: 0;
    border: none;
  }
  #main summary {
    border-radius: 0;
  }
  form {
    width: 100%;
  }
}
