/* auth.css - 登录页 */

.auth-page {
  position: relative;
  width: 100%;
  height: 100vh;
  min-height: 100vh;
  background:
    linear-gradient(180deg, #f9f9f7 0%, #ffffff 44%, #f4f4f1 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 34px 24px calc(34px + env(safe-area-inset-bottom));
  overflow: hidden;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.auth-grid {
  position: absolute;
  inset: -1px;
  background-image:
    linear-gradient(rgba(30, 30, 30, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(30, 30, 30, 0.03) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(180deg, transparent 0%, #000 18%, #000 72%, transparent 100%);
  opacity: 0.55;
}

.auth-line {
  position: absolute;
  height: 1px;
  width: 82%;
  background: linear-gradient(90deg, transparent, rgba(0, 0, 0, 0.16), transparent);
  transform-origin: center;
  opacity: 0.45;
}

.auth-line-a {
  top: 17%;
  left: -18%;
  transform: rotate(-18deg);
}

.auth-line-b {
  right: -26%;
  bottom: 20%;
  transform: rotate(-24deg);
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: authIn 0.55s var(--ease) both;
}

@keyframes authIn {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  padding: 0 10px;
}

.auth-logo {
  width: 74px;
  height: 74px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 20px 48px rgba(0, 0, 0, 0.14),
    0 1px 0 rgba(255, 255, 255, 0.9) inset;
  flex-shrink: 0;
}

.auth-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.auth-kicker {
  margin-top: 10px;
  font-size: 10px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.28em;
  color: rgba(58, 58, 58, 0.46);
}

.auth-title {
  font-size: 30px;
  font-weight: 500;
  color: #2f2f2f;
  line-height: 1.1;
}

.auth-subtitle {
  font-size: 13px;
  color: rgba(58, 58, 58, 0.52);
  line-height: 1.45;
}

.auth-form {
  position: relative;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 28px;
  box-shadow:
    0 28px 70px rgba(38, 38, 38, 0.13),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
}

.auth-icon-card {
  width: 100%;
  min-height: 58px;
  padding: 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.78);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  color: #323232;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow:
    0 16px 38px rgba(38, 38, 38, 0.1),
    0 1px 0 rgba(255, 255, 255, 0.86) inset;
  backdrop-filter: blur(22px) saturate(1.08);
  -webkit-backdrop-filter: blur(22px) saturate(1.08);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}

.auth-icon-card:active {
  transform: scale(0.985);
  background: rgba(255, 255, 255, 0.88);
}

.auth-icon-card-symbol {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: #282828;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}

.auth-icon-card-label {
  flex: 1;
  text-align: left;
  font-size: 15px;
  font-weight: 500;
}

.auth-icon-card-chevron {
  color: rgba(58, 58, 58, 0.32);
  font-size: 12px;
}

/* ===== 登录页桌面图标弹窗 ===== */
.auth-icon-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: rgba(22, 22, 22, 0.32);
  opacity: 0;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.18s ease;
}

.auth-icon-modal-overlay.show { opacity: 1; }

.auth-icon-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  z-index: 501;
  width: calc(100% - 32px);
  max-width: 400px;
  padding: 18px 18px 14px;
  border: 1px solid rgba(255, 255, 255, 0.86);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.22);
  opacity: 0;
  transform: translate(-50%, -46%) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s var(--ease);
}

.auth-icon-modal.show {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.auth-icon-modal-head {
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.auth-icon-modal-title {
  flex: 1;
  font-size: 17px;
  font-weight: 600;
  color: #2f2f2f;
}

.auth-icon-modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #efefed;
  color: #777;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
}

.auth-icon-choice-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.auth-icon-choice {
  position: relative;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #3a3a3a;
}

.auth-icon-choice-image {
  width: min(100%, 64px);
  aspect-ratio: 1;
  margin: 0 auto;
  border: 3px solid transparent;
  border-radius: 17px;
  background: #f0f0ee;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: transform 0.16s var(--ease), border-color 0.16s var(--ease);
}

.auth-icon-choice:active .auth-icon-choice-image { transform: scale(0.95); }
.auth-icon-choice.selected .auth-icon-choice-image { border-color: #525252; }

.auth-icon-choice-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.auth-icon-custom-image {
  border-width: 2px;
  border-color: rgba(58, 58, 58, 0.34);
  color: rgba(58, 58, 58, 0.55);
  font-size: 20px;
}

.auth-icon-choice.selected .auth-icon-custom-image { border-width: 3px; }

.auth-icon-choice-name {
  display: block;
  margin-top: 7px;
  font-size: 11px;
  line-height: 1.25;
  white-space: nowrap;
}

.auth-icon-choice-check {
  position: absolute;
  top: -5px;
  right: max(-2px, calc(50% - 39px));
  width: 20px;
  height: 20px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #343434;
  color: #fff;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 9px;
}

.auth-icon-choice.selected .auth-icon-choice-check { display: flex; }

.auth-icon-modal-error {
  min-height: 18px;
  margin-top: 10px;
  color: var(--c-red);
  font-size: 11px;
  line-height: 1.45;
  text-align: center;
}

.auth-icon-modal.is-busy .auth-icon-choice,
.auth-icon-modal.is-busy .auth-icon-modal-close {
  opacity: 0.55;
  pointer-events: none;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.auth-field label {
  padding-left: 2px;
  font-size: 12px;
  font-weight: 500;
  color: rgba(58, 58, 58, 0.58);
}

.auth-input-wrap {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(0, 0, 0, 0.075);
  border-radius: 17px;
  background: rgba(250, 250, 249, 0.88);
  color: #323232;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 15px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9) inset;
}

.auth-input-wrap i {
  width: 16px;
  color: rgba(58, 58, 58, 0.36);
  font-size: 13px;
  text-align: center;
}

.auth-input {
  width: 100%;
  min-width: 0;
  height: 48px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #2f2f2f;
  padding: 0;
  font-size: 16px;
  outline: none;
  caret-color: #2f2f2f;
  box-shadow: none;
  -webkit-appearance: none;
}

.auth-input::placeholder {
  color: rgba(58, 58, 58, 0.34);
}

.auth-input:focus,
.auth-input:focus-visible {
  outline: none;
  background: transparent;
  box-shadow: none;
}

.auth-input:-webkit-autofill,
.auth-input:-webkit-autofill:hover,
.auth-input:-webkit-autofill:focus,
.auth-input:-webkit-autofill:active {
  border: 0;
  -webkit-text-fill-color: #2f2f2f;
  caret-color: #2f2f2f;
  -webkit-box-shadow: 0 0 0 1000px #fafaf9 inset;
  box-shadow: 0 0 0 1000px #fafaf9 inset;
  transition: background-color 9999s ease-out 0s;
}

.auth-button {
  min-height: 50px;
  border-radius: 17px;
  background: #282828;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin-top: 2px;
  box-shadow:
    0 14px 28px rgba(0, 0, 0, 0.18),
    0 1px 0 rgba(255, 255, 255, 0.16) inset;
  transition:
    transform var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease),
    opacity var(--dur) var(--ease);
}

.auth-button:active {
  transform: translateY(1px);
  box-shadow:
    0 9px 18px rgba(0, 0, 0, 0.16),
    0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.auth-button:disabled {
  opacity: 0.58;
  cursor: default;
}

.auth-message {
  min-height: 18px;
  font-size: 12px;
  color: rgba(58, 58, 58, 0.5);
  line-height: 1.5;
  text-align: center;
}

.auth-message.error { color: var(--c-red); }
.auth-message.success { color: #66756b; }

@media (max-height: 660px) {
  .auth-page {
    justify-content: flex-start;
    padding-top: 28px;
    overflow-y: auto;
  }

  .auth-panel {
    gap: 18px;
  }

  .auth-logo {
    width: 62px;
    height: 62px;
    border-radius: 19px;
  }

  .auth-title {
    font-size: 26px;
  }
}
