/* ============================================================
   auth.css — Authentication UI styles
   Integrates with RouteForge's dark industrial aesthetic
============================================================ */

/* ── Overlay backdrop ─────────────────────────────────── */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 6, 9, 0.82);
  backdrop-filter: blur(6px);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: auth-fade-in 0.18s ease;
}
.auth-overlay.hidden { display: none !important; }

@keyframes auth-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── Modal box ───────────────────────────────────────── */
.auth-modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 64px rgba(0,0,0,0.7);
  width: 100%;
  max-width: 420px;
  padding: 28px 28px 22px;
  position: relative;
  animation: auth-slide-in 0.2s ease;
  max-height: 90vh;
  overflow-y: auto;
}

@keyframes auth-slide-in {
  from { transform: translateY(12px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 15px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s;
  padding: 0;
}
.auth-modal-close:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

/* ── Tab bar ──────────────────────────────────────────── */
.auth-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0;
}
.auth-tab {
  flex: 1;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 500;
  padding: 8px 12px 10px;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: -1px;
}
.auth-tab:hover { color: var(--text-primary); }
.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ── Form elements ────────────────────────────────────── */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.auth-field label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
}
.auth-hint {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  font-family: var(--font-mono);
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s;
}
.auth-form input:focus {
  border-color: var(--accent);
}
.auth-form input::placeholder {
  color: var(--text-muted);
}

.auth-pw-wrap {
  position: relative;
  display: flex;
}
.auth-pw-wrap input {
  flex: 1;
  padding-right: 40px !important;
}
.auth-pw-eye {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.auth-pw-eye:hover { color: var(--text-primary); }

/* ── Password strength meter ─────────────────────────── */
.auth-strength {
  height: 3px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-top: 4px;
  overflow: hidden;
}
.auth-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.25s, background 0.25s;
}
.auth-strength-label {
  font-size: 10px;
  font-family: var(--font-mono);
  min-height: 14px;
  display: block;
}

/* ── Error / success messages ─────────────────────────── */
.auth-error {
  font-size: 12px;
  color: var(--danger);
  background: rgba(224, 82, 82, 0.1);
  border: 1px solid rgba(224, 82, 82, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
}
.auth-error-ok {
  font-size: 12px;
  color: var(--success);
  background: rgba(82, 192, 122, 0.1);
  border: 1px solid rgba(82, 192, 122, 0.3);
  border-radius: 6px;
  padding: 7px 10px;
}
.auth-error.hidden,
.auth-error-ok.hidden { display: none !important; }

.auth-submit {
  margin-top: 4px;
  font-size: 14px;
  padding: 11px;
}

.auth-footer-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  font-family: var(--font-mono);
}

/* ── Header auth button ───────────────────────────────── */
.auth-header-btn {
  display: flex;
  align-items: center;
  gap: 6px;
}
.auth-avatar {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0b0e;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-family: var(--font-mono);
}

/* ── Dashboard box ────────────────────────────────────── */
.auth-dashboard-box {
  max-width: 480px;
}

.dash-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.dash-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #0a0b0e;
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  flex-shrink: 0;
}
.dash-username {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: 0.06em;
  color: var(--text-primary);
}
.dash-email {
  font-size: 12px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
}

.dash-sections {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.dash-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.dash-section-title {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.dash-badge {
  font-size: 9px;
  background: var(--bg-hover);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  padding: 2px 6px;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.dash-kv-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
}
.dash-kv-row span:last-child {
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 12px;
}

.dash-token-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
}
.dash-token-box code {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.dash-token-copy {
  flex-shrink: 0;
  padding: 4px 8px;
  font-size: 13px;
}

.dash-note {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.5;
}
.dash-note-warn {
  color: var(--danger);
}

.dash-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dash-form input[type="password"] {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: border-color 0.15s;
}
.dash-form input:focus { border-color: var(--accent); }
.dash-form input::placeholder { color: var(--text-muted); }

.dash-danger-zone { border-color: rgba(224, 82, 82, 0.25); }
.dash-danger-zone .dash-section-title { color: #e07052; }

.dash-delete-btn {
  color: var(--danger);
  border-color: rgba(224, 82, 82, 0.3);
  font-size: 13px;
  align-self: flex-start;
}
.dash-delete-btn:hover { background: rgba(224, 82, 82, 0.1); }

.dash-delete-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}
.dash-delete-confirm {
  background: var(--danger);
  color: #fff;
  font-weight: 600;
  border: none;
  flex: 1;
  justify-content: center;
}
.dash-delete-confirm:hover { background: #c0393b; }

.dash-footer {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}

/* ── Saved routes panel ───────────────────────────────── */
.routes-panel-box {
  max-width: 500px;
}
.routes-panel-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
  max-height: 55vh;
  overflow-y: auto;
}
.routes-panel-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  padding: 30px 0;
  line-height: 1.8;
}
.routes-error { color: var(--danger); }

.route-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.15s;
}
.route-row:hover { border-color: var(--border-light); }
.route-row-info {
  flex: 1;
  min-width: 0;
}
.route-row-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-row-meta {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
  margin-top: 3px;
}
.route-row-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.route-load-btn {
  font-size: 12px;
  padding: 6px 12px;
}
.route-delete-btn {
  font-size: 12px;
  padding: 6px 10px;
  color: var(--danger);
  border-color: rgba(224, 82, 82, 0.3);
}
.route-delete-btn:hover { background: rgba(224, 82, 82, 0.1); }

.routes-panel-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
}
.routes-count-label {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-muted);
}