/* ============================================
   TKM Web App - Auth pages (login, password-reset)
   Design: tiled diagmonds background, large TKM icon, glass morphism card
   ============================================ */

/* Theme toggle on auth pages: solid background so it stands out on patterned bg */
body.page-auth .theme-toggle-fixed .theme-toggle-single {
  background: #ffffff !important;
  color: #1a1d24;
  border-color: rgba(0, 0, 0, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}
body.page-auth .theme-toggle-fixed .theme-toggle-single:hover {
  background: #f5f6f8 !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22);
}
[data-theme="dark"] body.page-auth .theme-toggle-fixed .theme-toggle-single {
  background: #2d2d2d !important;
  color: #e8eaed;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] body.page-auth .theme-toggle-fixed .theme-toggle-single:hover {
  background: #3c4043 !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.55);
}

/* ---------- Auth page: tiled background + large icon ---------- */
.auth-page {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  overflow: hidden;
}

/* Tiled diagmonds pattern (light: diagmonds-light.png, dark: diagmonds.png) */
.auth-bg-pattern {
  position: absolute;
  inset: 0;
  background-color: #8f8f8f;
  background-image: var(--auth-pattern);
  background-repeat: repeat;
  background-size: auto;
}

/* Large semi-transparent crossed knives behind the card */
.auth-bg-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(85vmin);
  height: min(85vmin);
  background-image: url('../images/TKM Icon.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  opacity: var(--auth-bg-icon-opacity);
  pointer-events: none;
}

/* ---------- Glass morphism card ---------- */
.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  padding: 2.5rem;
  border-radius: 18px;
  background: var(--auth-glass-bg);
  border: 1px solid var(--auth-glass-border);
  box-shadow: var(--auth-glass-shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

/* ---------- Login: branding block ---------- */
.auth-brand {
  text-align: center;
  margin-bottom: 1.75rem;
}

.auth-estd {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 120px;
  margin: 0 auto 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
}

.auth-card .auth-icon {
  display: block;
  width: 80px;
  height: auto;
  margin: 0 auto 0.5rem;
  color: var(--text-primary);
}

[data-theme="dark"] .auth-card .auth-icon {
  filter: invert(1) brightness(1.1);
}

.auth-card .auth-logo {
  display: block;
  max-width: 220px;
  width: 100%;
  height: auto;
  margin: 0 auto 0.25rem;
}

[data-theme="dark"] .auth-card .auth-logo {
  filter: invert(1) brightness(1.1);
}

.auth-tagline {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin: 0;
}

/* ---------- Form ---------- */
.auth-card .form-group {
  margin-bottom: 1rem;
}

.auth-card .form-group:last-of-type {
  margin-bottom: 0;
}

.auth-card .form-group label {
  color: var(--text-primary);
}

.auth-card .required-asterisk {
  color: var(--accent-red, #c62828);
}

.auth-card .input {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border);
}

/* Password field with show/hide toggle */
.password-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  overflow: hidden;
}

.password-input-wrap .input {
  flex: 1;
  border: none;
  border-radius: 0;
}

.password-toggle-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-left: 1px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
}

.password-toggle-btn:hover {
  color: var(--text-primary);
  background: var(--surface-2);
}

.auth-options {
  margin-top: 0.75rem;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: flex-end;
}

.auth-stay-signed-in {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 400;
}

.auth-stay-signed-in input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.auth-submit {
  width: 100%;
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(46, 125, 50, 0.35);
}

.auth-submit:hover {
  background: var(--accent-hover);
}

/* ---------- Links below submit ---------- */
.auth-links {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.875rem;
}

.auth-links a {
  color: var(--text-secondary);
  text-decoration: underline;
}

.auth-links a:hover {
  color: var(--accent);
}

.auth-links-sep {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

/* ---------- Shared: test creds, invite message (login) ---------- */
.auth-test-creds {
  margin-top: 1.25rem;
  padding: 0.75rem 1rem;
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-radius: 10px;
  line-height: 1.6;
}

.auth-test-creds code {
  background: var(--surface);
  padding: 0.15rem 0.35rem;
  border-radius: 4px;
  font-size: 0.7rem;
}

.auth-invite-message {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-secondary);
  background: var(--surface-2);
  border-radius: 10px;
  line-height: 1.5;
}

/* ---------- Password reset page (keeps .auth-card h1, .subtitle, .footer-link) ---------- */
.auth-card h1 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 0.25rem;
  text-align: center;
  color: var(--text-primary);
}

.auth-card .subtitle {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  letter-spacing: 0.05em;
}

.auth-card .btn-block {
  width: 100%;
  margin-top: 1rem;
  padding: 0.625rem;
}

.auth-card .footer-link {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9375rem;
  color: var(--text-secondary);
}

.auth-card .footer-link a {
  color: var(--accent);
  font-weight: 500;
}

.auth-card .forgot-link {
  font-size: 0.875rem;
}

.auth-reset-success {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  text-align: center;
  color: var(--text-primary);
  background: var(--accent-light, #e8f5e9);
  border: 1px solid rgba(46, 125, 50, 0.25);
  border-radius: 10px;
  line-height: 1.5;
}

[data-theme="dark"] .auth-reset-success {
  background: rgba(46, 125, 50, 0.15);
  border-color: rgba(46, 125, 50, 0.3);
}
