.aopc-auth,
.aopc-auth * { box-sizing: border-box; }

.aopc-auth {
  --red: #e40137;
  --text: #111;
  --muted: #8e99a2;
  --border: #e7e7e9;
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  min-height: 560px;
  padding: 20px;
  color: var(--text);
  font-family: Danam, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5em;
}

.aopc-auth button,
.aopc-auth input { font: inherit; }

.aopc-auth__box {
  width: min(500px, 100%);
  padding: 20px 18px;
  border-radius: 8px;
  background: #fff;
}

.aopc-auth__logo {
  display: block;
  width: 130px;
  height: auto;
  margin: 0 auto 10px;
}

.aopc-auth__step { text-align: center; }
.aopc-auth__step[hidden] { display: none; }
.aopc-auth__step h2 { margin: 0 0 10px; color: var(--text); font-size: 20px; font-weight: 500; }
.aopc-auth__step p { margin: 0 auto 28px; color: var(--text); }
.aopc-auth__step form { display: grid; gap: 12px; }

.aopc-auth input[type="text"],
.aopc-auth input[type="tel"] {
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
  text-align: right;
  box-shadow: none;
}

.aopc-auth input:focus { border-color: var(--border); box-shadow: none; }
.aopc-auth input::placeholder { color: #777; opacity: 1; }

.aopc-auth form > button[type="submit"] {
  min-height: 56px;
  border: 0;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  cursor: pointer;
  box-shadow: none;
}

.aopc-auth form > button[type="submit"]:hover,
.aopc-auth form > button[type="submit"]:focus,
.aopc-auth form > button[type="submit"]:active { background: var(--red); color: #fff; box-shadow: none; }
.aopc-auth button:disabled { cursor: default; opacity: .6; }

.aopc-auth__avatars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin: 6px 4px 18px;
}

.aopc-auth__avatars label { position: relative; display: block; cursor: pointer; }
.aopc-auth__avatars input { position: absolute; opacity: 0; pointer-events: none; }
.aopc-auth__avatars img { display: block; width: 100%; aspect-ratio: 1; border: 2px solid transparent; border-radius: 7px; object-fit: cover; }
.aopc-auth__avatars input:checked + img { border-color: var(--red); }

.aopc-auth__actions { display: flex; justify-content: space-between; gap: 12px; }
.aopc-auth__actions button { padding: 4px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.aopc-auth__actions button:hover,
.aopc-auth__actions button:focus { background: transparent; color: var(--muted); }
.aopc-auth__timer,
.aopc-auth__message { min-height: 20px; color: var(--muted); text-align: center; }
.aopc-auth__message:not(:empty) { color: var(--red); }

.aopc-auth__toast {
  position: fixed;
  z-index: 999999;
  top: 24px;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  transform: translateX(-50%);
  box-shadow: 0 8px 24px rgba(0,0,0,.08);
  animation: aopc-toast-drop .32s ease-out both;
}
.aopc-auth__toast[hidden] { display: none; }
.aopc-auth__toast img { width: 22px; height: 22px; }
.aopc-auth form.is-loading { pointer-events: none; opacity: .55; }

@keyframes aopc-toast-drop {
  from { opacity: 0; transform: translate(-50%, -28px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .aopc-auth__toast { animation: none; }
}

@media (max-width: 767px) {
  .aopc-auth { min-height: 500px; padding: 10px; font-size: 13px; }
  .aopc-auth__box { padding: 18px 12px; }
  .aopc-auth__step h2 { font-size: 18px; }
  .aopc-auth__step p { margin-bottom: 22px; }
  .aopc-auth__avatars { gap: 7px; margin-inline: 0; }
  .aopc-auth form > button[type="submit"] { min-height: 50px; }
}
