/* Touch hover revision 1: compiler guards hover while preserving selected states. */
@font-face {
  font-family: "Inter";
  src: url("/admin/static/fonts/Inter-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter";
  src: url("/admin/static/fonts/Inter-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

:root {
  --auth-bg: #f5f7fb;
  --auth-panel: #ffffff;
  --auth-text: #171923;
  --auth-muted: #a7b3c7;
  --auth-line: #e6ecf4;
  --auth-blue: #3864ff;
  --auth-blue-dark: #244ff0;
  --auth-danger: #dc2626;
  --auth-ok: #047857;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI Variable", "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--auth-text);
  background: var(--auth-bg);
}

.auth-shell,
.auth-shell input,
.auth-shell button,
.auth-shell a {
  font-family: inherit;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-frame {
  width: min(100%, 366px);
}

.auth-card {
  width: 100%;
  padding: 30px 24px 26px;
  border: 1px solid rgba(230, 236, 244, 0.86);
  border-radius: 18px;
  background: var(--auth-panel);
  box-shadow: 0 20px 46px rgba(18, 31, 56, 0.11);
}

.auth-head {
  margin: 0 0 24px;
  text-align: center;
}

.auth-head h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
  font-weight: 600;
}

.auth-head p {
  margin: 10px auto 0;
  max-width: 340px;
  color: #7c899d;
  font-size: 14px;
  line-height: 1.45;
}

.auth-form {
  display: grid;
  gap: 15px;
  width: 100%;
  margin: 0 auto;
}

.auth-field {
  position: relative;
  display: block;
}

.auth-field span {
  position: absolute;
  top: -9px;
  left: 22px;
  z-index: 1;
  padding: 0 7px;
  color: var(--auth-muted);
  background: var(--auth-panel);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.auth-field span::after {
  content: " *";
  color: #ef4444;
}

.auth-field input {
  width: 100%;
  height: 52px;
  border: 2px solid #9eb2ff;
  border-radius: 12px;
  padding: 0 15px;
  color: #4a4f59;
  background: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.auth-field input:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *),
.auth-field input:focus {
  border-color: var(--auth-blue);
  box-shadow: 0 0 0 4px rgba(56, 100, 255, 0.12);
}

.auth-submit {
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--auth-blue);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}

.auth-submit:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *) {
  background: var(--auth-blue-dark);
  box-shadow: 0 14px 34px rgba(56, 100, 255, 0.22);
  transform: translateY(-1px);
}

.auth-forgot {
  justify-self: center;
  margin-top: -4px;
  color: var(--auth-blue);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.auth-forgot:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *),
.auth-forgot:focus-visible {
  color: var(--auth-blue-dark);
  outline: none;
}

.auth-divider {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  margin: 26px auto 20px;
  color: #b0bbcd;
  font-size: 18px;
  font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  height: 1px;
  background: var(--auth-blue);
}

.auth-google {
  width: 100%;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 auto;
  border: 1px solid var(--auth-line);
  border-radius: 12px;
  background: #fff;
  color: #4b5563;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.auth-google:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *) {
  border-color: #ccd6e6;
  box-shadow: 0 12px 30px rgba(18, 31, 56, 0.08);
  transform: translateY(-1px);
}

button.auth-google:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
  box-shadow: none;
}

.auth-google-icon {
  width: 22px;
  height: 22px;
}

.auth-alt {
  display: block;
  margin-top: 18px;
  text-align: center;
  color: var(--auth-blue);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.auth-alt:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *) {
  color: var(--auth-blue-dark);
}

.auth-notices {
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 20;
  display: grid;
  gap: 8px;
  width: min(350px, calc(100vw - 32px));
  pointer-events: none;
}

.auth-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  pointer-events: auto;
  margin: 0;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.13);
}

.auth-notice-message { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.auth-notice-close {
  flex: 0 0 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: -4px -6px -4px 0;
  padding: 8px;
  border: 0;
  border-radius: 6px;
  color: inherit;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.auth-notice-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.auth-notice-close:focus-visible { outline: 2px solid currentColor; outline-offset: -2px; }
.auth-field-readonly span::after { content: none; }
.auth-field-readonly input { border-color: var(--auth-line); color: #7c899d; background: #f8fafc; font-size: 14px; }
.auth-field-readonly input:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *),
.auth-field-readonly input:focus { border-color: var(--auth-line); box-shadow: none; }

.auth-notice.danger {
  color: var(--auth-danger);
  background: #fff1f2;
  border: 1px solid #fecdd3;
}

.auth-notice.ok {
  color: var(--auth-ok);
  background: #ecfdf5;
  border: 1px solid #bbf7d0;
}

@media (max-width: 720px) {
  .auth-shell {
    padding: 16px;
  }

  .auth-card {
    padding: 30px 20px 26px;
    border-radius: 18px;
  }

  .auth-head {
    margin-bottom: 24px;
  }

  .auth-head h1 {
    font-size: 24px;
  }

  .auth-head p {
    font-size: 13px;
  }

  .auth-field span {
    left: 20px;
    font-size: 13px;
  }

  .auth-field input,
  .auth-submit {
    height: 50px;
    padding: 0 16px;
    font-size: 15px;
  }

  .auth-submit {
    font-size: 17px;
  }

  .auth-divider {
    margin: 24px auto 18px;
    gap: 14px;
    font-size: 17px;
  }

  .auth-google {
    width: 100%;
    height: 48px;
    min-height: 0;
    border-radius: 12px;
    font-size: 14px;
  }

  .auth-google-icon {
    width: 22px;
    height: 22px;
  }
}

.auth-help-footer{display:flex;justify-content:center;margin-top:10px}
.auth-help-link{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:8px 18px;color:#6b7d94;font-size:13px;text-decoration:none}
.auth-help-link:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:6px}
@media(hover:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *)) and (pointer:fine){.auth-help-link:hover:where(html:not([data-phone-layout]):not([data-touch-input]) *){color:#2563eb}}

/* Progressive password visibility; the existing auth field geometry is unchanged. */
.auth-password-field { position: relative; }
.auth-password-field .auth-field input { padding-right: 54px; }
.auth-password-field input::-ms-reveal { display: none; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 10px;
  margin: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #7c899d;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.auth-password-toggle svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.auth-password-toggle:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: -3px; }

/* Keep the original Google control available during its separate sign-in. */
.auth-google-pending { margin: 12px 0 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 1.4; color: #7c899d; }
.auth-google-cancel { flex-shrink: 0; min-height: 36px; padding: 6px 8px; border: 0; border-radius: 6px; background: transparent; color: var(--auth-blue); font: inherit; cursor: pointer; }
.auth-google-cancel:focus-visible { outline: 2px solid var(--auth-blue); outline-offset: 2px; }
.auth-google-continue { display: flex; align-items: center; justify-content: center; text-decoration: none; }
