/* Auth screens also run as a standalone iPhone web app. Keep editable text
   at 16px so focusing a field does not trigger Safari's automatic zoom. */
.authwrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100svh;
  padding: 24px;
  padding-top: max(24px, env(safe-area-inset-top, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  padding-bottom: max(24px, env(safe-area-inset-bottom, 0px));
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
.authwrap, .authwrap *, .authwrap *::before, .authwrap *::after {
  box-sizing: border-box;
}
.authcard {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: 420px;
  margin: 0;
  padding: 32px;
  overflow-wrap: anywhere;
}
.authcard form, .authcard label {
  width: 100%;
  min-width: 0;
}
.authcard .brand {
  display: flex;
  padding: 0;
  margin-bottom: 24px;
  font-size: 24px;
  line-height: 1.2;
}
.authcard h1 {
  font-size: clamp(24px, 6.4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.7px;
}
.authcard p {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.55;
}
.authcard label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
  font-size: 14px;
  line-height: 1.4;
}
.authcard input, .authcard select, .authcard textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.4;
}
.authcard .primary {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  margin: 4px 0 20px;
  padding: 13px 16px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.4;
  white-space: normal;
}
.authcard small {
  display: block;
  font-size: 12px;
  line-height: 1.6;
}
.authcard .formerror {
  color: #a94d60;
}
@media (max-width: 480px) {
  .authcard {
    padding: 24px;
    border-radius: 20px;
  }
}
@media (max-width: 359px) {
  .authwrap {
    padding-right: max(12px, env(safe-area-inset-right, 0px));
    padding-left: max(12px, env(safe-area-inset-left, 0px));
  }
  .authcard {
    padding: 20px;
  }
}
@media (max-height: 540px) and (orientation: landscape) {
  .authwrap {
    justify-content: flex-start;
  }
}

.account-delete-confirm {
  padding: 12px 14px;
  border: 1px solid #f1c8cf;
  border-radius: 12px;
  background: #fff7f8;
}
.account-delete-confirm p { margin: 6px 0 10px; }

@media (min-width: 761px) {
  .authwrap {
    background:
      radial-gradient(ellipse at 88% 0%, #41659a 0%, transparent 51%),
      radial-gradient(ellipse at 12% 98%, #275681 0%, transparent 56%),
      linear-gradient(135deg, #081528, #142f4d 61%, #102842);
    color: #ecf5ff;
  }
  .authwrap .authcard { color: #0e243b; }
  .auth-login-layout--qr {
    display: grid;
    align-items: stretch;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
    gap: 0;
    max-width: 820px;
    border: 1px solid #fff8;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 32px 110px #030d20a6, 0 4px 16px #07152947;
    animation: auth-card-enter 580ms cubic-bezier(.2,.7,.2,1) both;
  }
  .auth-login-layout--qr > .authcard {
    max-width: none;
    padding: 34px clamp(30px, 4vw, 52px);
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .auth-login-layout--qr .desktop-qr {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    width: auto;
    min-width: 0;
    padding: 34px clamp(28px, 3.5vw, 44px);
    border-radius: 0;
    border-left: 1px solid #d8e4f4;
    background:
      radial-gradient(ellipse at 100% 0%, #d2e4ff, transparent 65%),
      linear-gradient(165deg, #f4f8ff, #eaf2fc);
    color: #102c4d;
  }
  .desktop-qr h2 {
    margin: 0 0 12px;
    font-size: 24px;
    line-height: 1.18;
    letter-spacing: -.035em;
  }
  .desktop-qr > p {
    margin: 0;
    color: #496280;
    font-size: 14px;
    line-height: 1.55;
  }
  .desktop-qr-frame {
    width: 208px;
    max-width: 100%;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    align-self: center;
    margin-top: 24px;
    border-radius: 20px;
    border: 1px solid #dbe6f4;
    background: #fff;
    box-shadow: 0 9px 28px #183e7914;
    overflow: hidden;
  }
  .desktop-qr-frame img {
    width: 100%;
    height: 100%;
    margin: 0;
    border-radius: 0;
    object-fit: contain;
    animation: auth-qr-enter 240ms ease-out both;
  }
  .desktop-qr-placeholder { color: #7396c2; }
  .desktop-qr-error { padding: 14px; text-align: center; font-size: 13px; }
  .desktop-qr-error p { margin: 0 0 12px; }
}
@keyframes auth-card-enter {
  from { opacity: 0; transform: translateY(16px) scale(.992); }
  to { opacity: 1; transform: none; }
}
@keyframes auth-qr-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-login-layout--qr, .desktop-qr-frame img { animation: none; }
}
