/* Login screen, password dialog and account menu. Uses the tokens from styles.css. */

html.auth-locked .app { display: none; }

.auth-screen {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; padding: 24px 16px; overflow: auto;
  background: radial-gradient(circle at 20% 10%, #1a2a31 0, #0d1418 55%);
}

.auth-card {
  width: min(400px, 100%); display: grid; gap: 16px; padding: 32px 28px;
  border-radius: 13px; background: var(--paper); box-shadow: 0 30px 80px rgba(0,0,0,.35);
}
.auth-card h1 { margin: 4px 0 0; font-size: 20px; }
.auth-lead { margin: 0; color: var(--ink-soft); font-size: 12px; line-height: 1.7; }
.auth-note { margin: 0; color: var(--muted); font-size: 11px; line-height: 1.7; }

.auth-brand { display: flex; align-items: center; gap: 12px; }
.auth-brand .brand-mark span { border-color: var(--accent-deep); }
.auth-brand-copy { display: flex; align-items: baseline; gap: 7px; font-family: var(--font-display); letter-spacing: .04em; }
.auth-brand-copy strong { font-size: 14px; }
.auth-brand-copy small { color: var(--accent-deep); font-size: 9px; letter-spacing: .2em; }

.auth-field { display: grid; gap: 6px; align-content: start; }
.auth-field label { font-size: 12px; font-weight: 600; }
.auth-field input {
  height: 40px; padding: 0 12px; border: 1px solid #c8d2d5; border-radius: 7px;
  background: #fff; color: var(--ink); font-size: 14px; outline: none;
}
.auth-field input:focus { border-color: var(--accent-deep); box-shadow: 0 0 0 3px rgba(131,185,36,.2); }
.auth-field small { color: var(--muted); font-size: 11px; }

.auth-error {
  margin: 0; padding: 10px 12px; border-radius: 7px;
  color: #8f2321; background: #fdecec; font-size: 12px; line-height: 1.6;
}

.auth-submit, .auth-secondary {
  height: 40px; padding: 0 18px; border-radius: 7px; cursor: pointer; font-size: 13px; font-weight: 700;
}
.auth-submit { border: 1px solid var(--accent-deep); background: var(--accent); color: var(--accent-ink); }
.auth-submit:hover:not(:disabled) { background: #c8ff5b; }
.auth-submit:disabled { opacity: .6; cursor: default; }
.auth-link { display: grid; place-items: center; text-decoration: none; }
.auth-secondary { border: 1px solid #c8d2d5; background: #fff; color: var(--ink); }
.auth-secondary:hover { background: #f1f4f5; }

.auth-dialog {
  width: min(440px, calc(100vw - 32px)); padding: 28px; border: 0; border-radius: 13px;
  box-shadow: 0 30px 80px rgba(14,23,27,.3);
}
.auth-dialog::backdrop { background: rgba(8,15,19,.52); backdrop-filter: blur(5px); }
.auth-dialog-form { display: grid; gap: 16px; }
.auth-dialog-form h2 { margin: 0; font-size: 18px; }
.auth-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; }

.auth-toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translateX(-50%);
  max-width: calc(100vw - 32px); padding: 12px 18px; border-radius: 8px;
  color: #fff; background: #1c292f; box-shadow: var(--shadow); font-size: 12px;
}

.auth-menu-wrap { position: relative; }
.auth-menu-toggle {
  height: 34px; max-width: 200px; display: inline-flex; align-items: center; gap: 8px; padding: 0 10px 0 4px;
  border: 1px solid #35434a; border-radius: 17px; background: transparent; color: #e6ecee; cursor: pointer; font-size: 11px;
}
.auth-menu-toggle:hover { background: #1c292f; }
.auth-avatar {
  width: 26px; height: 26px; display: grid; place-items: center; flex: none;
  border-radius: 50%; background: var(--accent); color: var(--accent-ink); font-weight: 700;
}
.auth-menu-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 50; min-width: 220px;
  display: grid; padding: 6px; border-radius: 10px; background: #fff; color: var(--ink); box-shadow: var(--shadow);
}
.auth-menu[hidden] { display: none; }
.auth-menu-head { display: grid; gap: 2px; padding: 10px; border-bottom: 1px solid var(--line-soft); margin-bottom: 4px; }
.auth-menu-head small { color: var(--muted); }
.auth-menu button {
  padding: 9px 10px; border: 0; border-radius: 6px; background: none; color: inherit;
  text-align: left; text-decoration: none; cursor: pointer; font-size: 12px;
}
.auth-menu button:hover { background: #f1f4f5; }

@media (max-width: 600px) {
  .auth-menu-name { display: none; }
  .auth-menu-toggle { padding: 0 4px; }
}
