@import url("/css/site-nav.css");

/* Auth pages — extends portal theme */
.auth-slot {
  display: flex;
  align-items: center;
}

.auth-login,
.auth-user {
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-weight: 600;
  transition: background 0.15s, border-color 0.15s;
}

.auth-login:hover,
.auth-user:hover {
  background: rgba(34, 211, 238, 0.14);
  border-color: rgba(34, 211, 238, 0.4);
}

.auth-user {
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-page .wrap {
  max-width: 440px;
  padding-top: 2rem;
}

.auth-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 1.75rem 1.5rem 1.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.auth-card h1 {
  font-family: "Syne", sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.auth-sub {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}

.auth-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  padding: 0.25rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.auth-tab.active {
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
}

.auth-mode-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.auth-mode {
  font-size: 0.8rem;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  font-family: inherit;
}

.auth-mode.active {
  color: var(--cyan);
  border-color: rgba(34, 211, 238, 0.35);
  background: rgba(34, 211, 238, 0.08);
}

.auth-field {
  margin-bottom: 0.9rem;
}

.auth-field label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.auth-field input {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
}

.auth-field input:focus {
  outline: none;
  border-color: rgba(34, 211, 238, 0.45);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.auth-row {
  display: flex;
  gap: 0.5rem;
}

.auth-row .auth-field {
  flex: 1;
}

.auth-otp-row {
  display: flex;
  gap: 0.5rem;
  align-items: stretch;
}

.auth-otp-row input {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.auth-otp-btn {
  width: auto;
  flex-shrink: 0;
  margin: 0 !important;
  min-width: 6.5rem;
  padding: 0 0.85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  font-size: 0.85rem;
  line-height: 1.2;
}

.auth-menu {
  position: relative;
}

.auth-user-btn {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid rgba(34, 211, 238, 0.25);
  background: rgba(34, 211, 238, 0.08);
  color: var(--cyan);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-dropdown {
  display: none;
  position: absolute;
  right: 0;
  top: calc(100% + 0.35rem);
  min-width: 9rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.35rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
  z-index: 20;
}

.auth-menu.open .auth-dropdown {
  display: block;
}

.auth-dropdown a,
.auth-dropdown button {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.5rem 0.65rem;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  text-decoration: none;
  cursor: pointer;
}

.auth-dropdown a:hover,
.auth-dropdown button:hover {
  background: rgba(255, 255, 255, 0.06);
}

.auth-dropdown .danger:hover {
  color: #f87171;
}

.auth-guest-nav {
  margin: -0.35rem 0 0.85rem;
}

.auth-back-home {
  color: var(--cyan);
  text-decoration: none;
  font-size: 0.9rem;
}

.auth-back-home:hover {
  text-decoration: underline;
}

.auth-tab,
.auth-mode,
.auth-btn,
.auth-field label {
  -webkit-text-fill-color: currentColor;
}

.auth-btn {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.7rem 1rem;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.9), rgba(56, 189, 248, 0.75));
  color: #041018;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
}

.auth-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.auth-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.auth-btn.secondary {
  width: auto;
  flex-shrink: 0;
  margin-top: 0;
  padding: 0.65rem 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  border: 1px solid var(--border);
}

.auth-msg {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  min-height: 1.25rem;
}

.auth-msg.error {
  color: #f87171;
}

.auth-msg.ok {
  color: var(--green);
}

.auth-msg.hint {
  color: var(--muted);
}

.auth-uid {
  margin: 1rem 0;
  padding: 0.75rem 0.85rem;
  border-radius: 10px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.2);
  font-size: 0.85rem;
}

.auth-uid code {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--cyan);
  word-break: break-all;
}

.auth-panel[hidden] {
  display: none !important;
}

.auth-logout {
  margin-top: 1rem;
  width: 100%;
  padding: 0.6rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  cursor: pointer;
}

.auth-logout-only {
  font-size: 0.85rem;
  padding: 0.35rem 0.75rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
}

.auth-logout-only:hover {
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.35);
}
